You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open_array is designed to either read an existing array or create a new one, if the the store_path object has the mode create and no existing array is found. However, creating an array requires specifying a shape as a positional argument to create, but shape is not one of the parameters of open_array, so open_array will always fail if the "create the array" branch is traversed, unless shape was provided in **kwargs, which is a strange API.
I'm not sure how to rescue this function in a way that preserves its intended functionality -- open_array(..., path='foo', shape=(100,)) will return an array with arbitrary shape if one happens to already exist at path foo, which is not good user experience (the user was expecting an array with shape (100,)). This is an API I always disliked about zarr v2; we should consider whether we want to keep it around.
The text was updated successfully, but these errors were encountered:
One path forward could be to raise an error if open_array finds an array that does not match the provided parameters (shape, type, etc.). Would that suffice here?
open_array
is designed to either read an existing array or create a new one, if the thestore_path
object has the modecreate
and no existing array is found. However, creating an array requires specifying a shape as a positional argument tocreate
, but shape is not one of the parameters ofopen_array
, soopen_array
will always fail if the "create the array" branch is traversed, unlessshape
was provided in**kwargs
, which is a strange API.I'm not sure how to rescue this function in a way that preserves its intended functionality --
open_array(..., path='foo', shape=(100,))
will return an array with arbitrary shape if one happens to already exist at pathfoo
, which is not good user experience (the user was expecting an array with shape (100,)). This is an API I always disliked about zarr v2; we should consider whether we want to keep it around.The text was updated successfully, but these errors were encountered: