home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 714801233

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/4529#issuecomment-714801233 https://api.github.com/repos/pydata/xarray/issues/4529 714801233 MDEyOklzc3VlQ29tbWVudDcxNDgwMTIzMw== 14808389 2020-10-22T22:38:52Z 2020-10-22T23:16:35Z MEMBER

I think this is a duplicate of #4483: xarray.core.variable.as_compatible_data doesn't have a special code path for DataArray and thus falls back to: https://github.com/pydata/xarray/blob/333e8dba55f0165ccadf18f2aaaee9257a4d716b/xarray/core/variable.py#L219 where DataArray.values will cast using numpy.asarray.

You should be able to work around that by using either xr.Dataset(dict(a=(('x', 'y'), ds.a.variable)) or xr.Dataset(dict(a=(('x', 'y'), ds.a.data))

4493 tries to fix this, but importing DataArray in as_compatible_data to avoid circular imports feels a bit unclean.

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