-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Check for minimum Zarr version. #1960
Conversation
kaipak
commented
Mar 3, 2018
•
edited by jhamman
Loading
edited by jhamman
- Closes ds.to_zarr error on creation #1954
xarray/backends/zarr.py
Outdated
|
||
if LooseVersion(zarr.__version__) < min_zarr: | ||
raise NotImplementedError("Zarr version %s or greater is " | ||
"required by xarray. See zarr " |
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.
W291 trailing whitespace
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.
One small suggestion, otherwise this looks great!
xarray/backends/zarr.py
Outdated
@@ -271,6 +272,14 @@ class ZarrStore(AbstractWritableDataStore): | |||
def open_group(cls, store, mode='r', synchronizer=None, group=None, | |||
writer=None): | |||
import zarr | |||
min_zarr = '2.2' | |||
|
|||
if LooseVersion(zarr.__version__) < min_zarr: |
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 you add # pragma: no cover
to indicate that this clause shouldn't be included in coverage calculations?
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.
Sure thing, hope I did it right!
xarray/backends/zarr.py
Outdated
@@ -271,6 +272,14 @@ class ZarrStore(AbstractWritableDataStore): | |||
def open_group(cls, store, mode='r', synchronizer=None, group=None, | |||
writer=None): | |||
import zarr | |||
min_zarr = '2.2' | |||
|
|||
if LooseVersion(zarr.__version__) < min_zarr: # pragma: no cover |
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.
E261 at least two spaces before inline comment
additional ws.