-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
add init_array, and data kwarg for create_array #2761
Conversation
Thank you |
Nice! I think it would be helpful to not hide away the change to |
good idea, I'll split it out |
#2763 should go in before this |
The tests look good. |
tests are actually incomplete -- I didn't test the synchronous version of |
I will get that in this evening |
Co-authored-by: Deepak Cherian <[email protected]>
@dstansby any idea why the release notes bot does not believe that I have added release notes? Is there something messed up with my release notes? |
Moves much of the logic currently contained in
create_array
down to a lower-level function calledinit_array
, that creates array metadata + saves it to storage.By popular request, I added a keyword argument to
create_array
:data
, that allows users to provide an array-like object (default isNone
), from which dtype and shape can be inferred. I'm not a fan of what this does to the function signature, but at lot of people wanted this 🤷♂️dtype
andshape
now default toNone
. If you specifydata
anddtype
, then you get a warning aboutdtype
being ignored in favor ofdata.dtype
, and similarly forshape
.In parallel with #2622, I also added a
write_data
kwarg that controls whetherdata
is written to the freshly created array. The default value here isTrue
, which IMO is unsafe, but also requested by users.As an indulgence. I also made some minor changes to the type aliases for
ChunkKeyEncoding
-- what we were callingChunkKeyEncodingLike
was actually a typeddict that should beChunkKeyEncodingParams
, andChunkKeyEncodingLike
should beChunkKeyEncoding | ChunkKeyEncodingParams
.closes #2707, and partially addresses concerns raised in #2689
TODO:
docs/user-guide/*.rst
changes/