-
-
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
WIP: Performance improvements for zarr backend #1800
Merged
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
a0bea98
move backend append logic to the prepare_variable methods
afdb254
deprecate variables/dimensions/attrs properties on AbstractWritableDa…
cc02150
warnings instead of errors for backend properties
86240cd
use attrs.update when setting zarr attributes
9c89ef2
more performance improvements to attributes in zarr backend
2568d21
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
d459c66
fix typo
c59ca57
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
2dd186a
Merge branch 'fix/zarr_set_attrs' of github.com:jhamman/xarray into f…
8f71b31
new set_dimensions method for writable data stores
07b9c21
Merge branch 'fix/zarr_set_attrs' of github.com:jhamman/xarray into f…
67fcd92
more fixes for zarr
b38e1a6
more tests for zarr and remove append logic for zarr
47ba8b6
more tests for zarr and remove append logic for zarr
9152b12
Merge branch 'fix/zarr_set_attrs' of github.com:jhamman/xarray into f…
26b6bcb
a few more tweaks to zarr attrs
b7681ae
Add encode methods to writable data stores, fixes for Zarr tests
e084e9e
fix for InMemoryDataStore
a6aeb36
fix for unlimited dimensions Scipy Datastores
264b13f
another patch for scipy
9c03bfc
whatsnew
c92020a
ordereddict
18434f9
address some of rabernats comments, in particular, this commit remove…
9f89c7c
stop skipping zero-dim zarr tests
3590d28
update minimum zarr version for tests
69cacee
Merge branch 'master' into fix/zarr_set_attrs
8d744e0
Merge branch 'master' into fix/zarr_set_attrs
a8dabdf
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
7858db7
Merge branch 'fix/zarr_set_attrs' of github.com:jhamman/xarray into f…
48bf7ef
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
53260c9
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
7ed6bf8
cleanup and docs for zarr performance branch
3872da2
fix two failing tests when using zarr master
e6b7068
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
c31decf
flake8
189d262
back to zarr 2.2
07b92e2
Merge branch 'master' of github.com:pydata/xarray into fix/zarr_set_a…
96996ef
remove extra store method
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why did you remove this part of the test?
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.
This is an interesting one. I wanted to see if the tests all passed after this change before bringing this up for discussion.
The key error that is raised here was being raised when looking for the
_DIMENSIONS_KEY
on the group. Now that each group doesn't have that key, it obviously isn't raised. So the question up for discussion is what should we do when we open a zarr group that doesn't have anything in it? Currently, an empty group is returned as an empty Dataset.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.
So this is related to my earlier comment. I think we should pick a behavior we want to support. Either
The current docs say the latter. However, having eliminated
_DIMENSION_KEY
from the group attributes, there is no way to check for whether the group was created by xarray if there are no variables.I can't imagine any scenario in which a user would want to open an empty zarr group in read-only mode. That would be useless. I imagine that this means the dataset was written with a group path but then the user forgot to specify a path when reading. So let's raise an error for now if the group is empty.
In a future PR, we can figure out how to more comprehensively support the reading of zarr datasets that do not have xarray's special attributes.
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.
Just to play devils advocate for a moment, The current behavior is consistent with how we treat groups in netCDF4. Consider the following example:
If we were to raise an error in the Zarr backend, would we want to check for the presence of variables or attributes?
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.
Ok, that's a pretty good point.
I'm fine with leaving as is.