-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Should we plan to deprecate File-mode-like semantics for accessing arrays and groups? #2466
Comments
I agree with all of this. If anything, I would make the dangerous operations more explicit. Zarr data is usually too large and precious to be destroyed by a single character mistake. For example, I'd be very careful with stuff like
for cases like that I'd prefer an error plus an explicit destroy operation. |
Totally agree. The API I was thinking of was |
I'd go as far as removing the "overwrite" argument, throw and exception and provide a |
It is for me! In an iteration phase I often repeatedly create stuff on disk that I'm happy overwriting. Although if safety is the goal then we could support this with a specific function that overwrites, e.g. |
I like that. In general, I think boolean arguments are a bit dangerous, boolean blindness and all that. But being explicit in the function name is a good middle ground. |
the semantics of our |
I'm all for more explicit arguments or functions rather than the
We use "overwrite" pretty often for cases where a worker might have been pre-empted and left store setup incomplete. |
i'm implementing some of these ideas in #2463, anyone interested should take a look |
Maybe I'm an outlier, but my Zarr data access falls into three categories, sorted by frequency:
foo
. Two sub-cases:foo
, so I'm happy getting a handle to an array or groupfoo
, optionally destroying anything already atfoo
.foo
. Two sub-cases:foo
, I want to create it and get a mutable handle to the array / group.foo
then there's no need to create anything, and I just want a mutable handle to that array or group.First, does anyone have a common Zarr access pattern that isn't one of these three?
Second, does anyone think our current top-level API maps on to the access patterns I listed? I personally do not think it does, and I suspect we can get some easy user experience gains by adding more specific and safe functions to the top-level API. See #2463.
Longer term, I think we should consider dropping File-mode-like semantics for our top-level API. maybe
open(mode=x)
makes sense for files, but I don't think that should be the basis for our user-facing API. We should provide a set of functions that actually match the access patterns users have.The text was updated successfully, but these errors were encountered: