New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zarr plugin #7
Zarr plugin #7
Conversation
(branched from #6 , commit log will look more reasonable after that is merged) |
kwargs: | ||
Further parameters are passed to xr.open_zarr | ||
""" | ||
from intake_xarray.xzarr import ZarrSource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this import to the beginning of the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No! We don't want to import until necessary, because import intake
would also import, and so take much longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I figured that might be why.
intake_xarray/xzarr.py
Outdated
self._mapper = get_mapper(protocol, self._fs, urlpath) | ||
self._ds = xr.open_zarr(self._mapper, **self.kwargs) | ||
|
||
def _get_schema(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we take the methods from here down and combine them with netcdf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
|
||
|
||
def get_mapper(protocol, fs, path): | ||
if protocol == 's3': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many more protocols do you think there will be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hdfs3 has a mapper and I am not aware of any others. You may have noticed that https://github.com/martindurant/filesystem_spec contains a mapper, so with any luck, it should "just work" for any file-system meeting the spec - but that's a long-term goal.
Tested locally and it works so far! Had to install a few dependencies.
|
Example