home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 652260859

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/pull/4187#issuecomment-652260859 https://api.github.com/repos/pydata/xarray/issues/4187 652260859 MDEyOklzc3VlQ29tbWVudDY1MjI2MDg1OQ== 23487320 2020-07-01T08:02:14Z 2020-07-01T22:23:27Z CONTRIBUTOR

I wonder if it's really worth deprecating open_zarr(). open_dataset(..., engine='zarr') is a bit more verbose, especially with backend_kwargs to pass optional arguments. It seems pretty harmless to keep open_zarr() around, especially if it's just an alias for open_datraset(engine='zarr').

Depends on which line in the Zen of Python you want to follow - "Simple is better than complex", or "There should be one-- and preferably only one --obvious way to do it". From a maintenance perspective, it's balancing the cost of a deprecation cycle vs writing code that tests both instances I guess.

We could also automatically detect zarr stores in open_dataset without requiring engine='zarr' if:

  1. the argument inherits from collections.abc.Mapping, and
  2. it contains a key '.zgroup', corresponding to zarr metadata.

As for the annoyance of needing to write backend_kwargs={"consolidated": True}, I wonder if we could detect this automatically by checking for the existence of a .zmetadata key? This would add a small amount of overhead (one file access) but this probably would not be prohibitively expensive.

These are some pretty good ideas. I also wonder if there's a way to mimic the dataset identifiers like in rasterio, something like xr.open_dataset("zarr:some_zarrfile.zarr"). Feels a lot more like fsspec's url chaining too.

Counter-argument would be that the cyclomatic complexity of open_dataset is already too high, and it really should be refactored before adding more 'magic'. Especially if new backend engines come online (e.g. #4142).

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