home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 604180511

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/3815#issuecomment-604180511 https://api.github.com/repos/pydata/xarray/issues/3815 604180511 MDEyOklzc3VlQ29tbWVudDYwNDE4MDUxMQ== 90008 2020-03-26T01:46:52Z 2020-03-26T01:46:52Z CONTRIBUTOR

I think the reason is that for zero sized arrays, you technically aren't allowed to write data to them.

https://github.com/pydata/xarray/blob/6378a711d50ba7f1ba9b2a451d4d1f5e1fb37353/xarray/backends/zarr.py#L449

This means that when you create the 0 sized array, you can't actually change the value.

Here is a reproducer without xarray python import zarr import numpy as np name = 'hello' data = np.array('world', dtype='<U5') store = zarr.ZipStore('test_store.zip', mode='w') root = zarr.open(store , mode='w') zarr_array = root.create_dataset(name, shape=data.shape, dtype=data.dtype) root[name][...] = data zarr_array[...]

Though the code path follows what xarray does in the backend.

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