-
-
Notifications
You must be signed in to change notification settings - Fork 329
Add ZARR_V3_API_AVAILABLE environment variable #1007
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
Conversation
controls whether or not v3 stores are imported into the top-level zarr namespace
Another reorganization I played with in a different branch is to split thematically similar stores into separate files as already done for
the v2 store classes are in these same files as well. I think that is a little better, but has the downside that it is a larger change that would likely create conflicts with many existing PRs. That branch is built on top of this one here: https://github.com/grlee77/zarr-python/tree/split-stores |
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
=======================================
Coverage 99.94% 99.94%
=======================================
Files 33 34 +1
Lines 13663 13710 +47
=======================================
+ Hits 13656 13703 +47
Misses 7 7
|
cc @rabernat @MSanKeys963 (also as we discussed this recently) |
I'll need to take a closer look, but if the new test is being run with both options by default, this would seem to make sense.
👍
Ok. need to think about that one, since this is essentially another route to the same thing as the environment variable. Maybe the environment variable is overkill and simply needing to import an explicit package for the moment is enough. I'll look through the existing imports using
Did you happen to try:
In general I'm 👍 for splitting |
@grlee77 did you have thoughts on Josh's questions above? Also would it be possible to resolve the merge conflicts here? |
I will revisit this later today. Right now the user cannot enable or disable v3 support at run time. The change here just causes I am also fine with moving the new file under zarr/_storage/v3.py as suggested above. |
@grlee77: let's call is sufficient for this PR. There are a few ongoing threads around V3 and we can loop back once those are all settled. Thanks!
👍 |
Okay, I fixed the conflicts and Linux tests now run with the environment variable enabled. In practice it is only the new test for symbol importing that relies on the environment variable. All other v3 tests still get run either way. |
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.
Thanks, @grlee77! Merging this as a finalization of the work that's already on the mainline. Pretty sure there's a general sigh of relief from everyone that you got us to this point. 🙌🏽
The next step is likely a general evaluation of the mainline and a decision on the release status. Unless someone else has a suggestion/proposal/etc., I'd say let's start getting 2.12.0a releases out. 🚀
attn: @joshmoore
This PR adds a ZARR_V3_API_AVAILABLE environment variable that controls whether various StoreV3 classes are publicly available via the base
zarr
namespace. There is one new test case corresponding to this (test_top_level_imports
). I could not recall from prior discussion if this was what was wanted or if there was something additional?As implemented here, even without defining the environment variable, the tests would run with both v3 and v2 cases and users could still use zarr version 3 classes via the convenience methods if
zarr_version=3
was specified. We could raise an error onzarr_version=3
in any of these functions if the environment variable is not set, but I'm not sure that is helpful?The second commit just moves v3-specific storage class code into a separate file to make the separation a bit cleaner.
TODO: