home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 831298605

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/5223#issuecomment-831298605 https://api.github.com/repos/pydata/xarray/issues/5223 831298605 MDEyOklzc3VlQ29tbWVudDgzMTI5ODYwNQ== 4160723 2021-05-03T14:31:14Z 2021-05-03T14:32:07Z MEMBER

I guess your last example works because Xarray's Dataset.to_zarr() does some operations (e.g., encoding datetime values as floats + adding encoding attributes like calendar and units) that Xarray-simlab doesn't (Xarray-simlab creates the zarr datasets by directly using the zarr-python API).

The key thing is adding units in variable encoding, e.g., from a Xarray-simlab output dataset:

ds_out.to_netcdf('test.nc', engine='netcdf4', encoding={'p__var': {'units': 'days since 2010-01-01 00:00:00'}})

Maybe we could borrow some logic from Dataset.to_zarr() in Xarray-simlab to encode datetime values when it is saved to zarr.

I think that we can then either close this issue or move it to Xarray-simlab.

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