home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 445355249

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
445355249 MDU6SXNzdWU0NDUzNTUyNDk= 2970 decode_cf 6872529 closed 0     1 2019-05-17T09:41:28Z 2020-03-29T14:02:24Z 2020-03-29T14:02:24Z NONE      

To me this name is a bit confusing as it actually encodes an in memory object to look like a decoded netcdf file.

I have a class which inherits (I know about dataset_accessor, still seems easier to simply inherit...) xarray.Dataset to which I've added a method _make_cf:

```python import xarray as xr class XResult(xr.Dataset): def init(self, data=None, coords=None, attrs=None, kwargs): if isinstance(data, str): kwargs = dict(READ_KWARGS, kwargs) with xr.open_dataset(data, **kwargs) as data: attrs = data.attrs

    super().__init__(data, coords, attrs)
    self._make_cf()

def _make_cf(self):
    self = xr.decode_cf(self)

``` I expect the XResult object to be decoded but it is not.

if I do xresult = xarray.decode_cf(XResult(...)) than the object is indeed decoded but is no longer an XResult object and loses the attached functionality.

It would be quite convenient to have a decode_cf or encode_cf method part of the Dataset class that will operate inplace.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2970/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 240.221ms · About: xarray-datasette