home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 242912131

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/987#issuecomment-242912131 https://api.github.com/repos/pydata/xarray/issues/987 242912131 MDEyOklzc3VlQ29tbWVudDI0MjkxMjEzMQ== 4992424 2016-08-27T11:34:28Z 2016-08-27T11:34:28Z NONE

@joonro, I think there's a strong case to be made about returning a DataArray with some metadata appended. Referring to the latest draft of the CF Metadata Conventions, there is a clear way to indicate when operations such as mean, max, or min have been applied to a variable by using the cell_methods attribute.

It might be more prudent to add this attribute whenever we apply these operations to a DataArray (or perhaps variable-wise when applied to a Dataset). That way, there is a clear reason to not return a scalar - the documentation of what operations were applied to produce that final result.

I can whip up a working example/pull request if people think this is a direction to go. I'd probably build a decorator which handles inspection of the operator name and arguments and uses that to add the cell_methods attribute, that way people can add the same functionality to homegrown methods/operators.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  173494017
Powered by Datasette · Queries took 0.805ms · About: xarray-datasette