home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 630662285

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/4076#issuecomment-630662285 https://api.github.com/repos/pydata/xarray/issues/4076 630662285 MDEyOklzc3VlQ29tbWVudDYzMDY2MjI4NQ== 13662783 2020-05-19T08:15:56Z 2020-05-19T08:15:56Z CONTRIBUTOR

Opening (and closing) a ZipStore when given a path ending in ".zip" would largely solve it I believe -- in fact, I tried just providing a path with ".zip" to to_zarr before, hoping it would work. (And indeed, I did so because the many small files are troublesome.)

open_zarr already automatically accepts path ".zip", so it would be nicely symmetric as well. However, this behavior exists within Zarr, not Xarray.

https://github.com/zarr-developers/zarr-python/blob/473576f3b17ac4a460dfccbcc4860606cd8123ed/zarr/creation.py#L130-142

I'd be happy to have a try at a PR in principle.

Maybe it could be as simple as adding a with? ```python

if isinstance(store, (str, pathlib.Path)): if str(store).endswith('.zip'): with zarr.ZipStore(store) as zstore:

etc

```

In the xarray.backends.api.to_zarr() function.

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