Skip to content

Conversation

@Mikejmnez
Copy link

Closes #70

There were a couple of permutations with the new added capabilities in xarray. For now, this added code makes it possible for intake to:

  1. When a single zarr file needs to be read, it still uses xr.open_zarr, as before, and the get_mapper option for the url_path as before. Another option is to use xr.open_dataset and use fspec.open_local, as it does in the netcdf case. I don't know enough to justify choosing between one or the other (xr.open_zarr is not being deprecated anymore), I just decided to still use xr.open_zarr for simplicity (no code change there).

  2. When multiple zarr files, a glob-path like /directoryA/subdir*/subsub*/* can be passed directly to xr.open_mfdataset. In such case, the code makes sure that engine='zarr' is passed as an argument.

In both cases, chunk='auto' is set as the default.

Miguel Jimenez-Urias added 25 commits April 23, 2020 19:01
…`xarray.open_mfdataset`` is implemented
@martindurant
Copy link
Member

@Mikejmnez : have you seen pydata/xarray#4461 ?

This solved the same sort of problem here, but at the higher level and with less code. We can definitely include this, at least until the xarray path is concrete.

 >       assert r['datashape'] is None

Datashape is no longer referenced in the intake main package, since it was always None and not used for anything. You can just remove these asserts.

@Mikejmnez
Copy link
Author

@martindurant I haven't seen it, thanks for pointing it out to me. Just to understand, with the new (high level) implementations, should url be passed as is into open_dataset? It looks like xarray will then be able to 'handle' the two different options (fs.get_mapper or the glob-path) when appropriate. Is this correct?

@martindurant
Copy link
Member

Exactly, xarray should handle all the cases via open_dataset or open_mfdataset. I'm not sure that there is a plan to detect that a URL is glob-like, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xarray.open_zarr to be deprecated

2 participants