Skip to content
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

Re-add data= in zarr.core.array.create_array #2707

Open
martindurant opened this issue Jan 14, 2025 · 3 comments · May be fixed by #2761
Open

Re-add data= in zarr.core.array.create_array #2707

martindurant opened this issue Jan 14, 2025 · 3 comments · May be fixed by #2761
Labels
help wanted Issue could use help from someone with familiarity on the topic

Comments

@martindurant
Copy link
Member

In V2, create_array allowed for passing data=, which was convenient for determining the shape, dtype and initial data of the created data.

arr = create_array(name,  dtype=arr.dtype, shape=arr.dtype)
arr[:] = arr

would simplify to

create_array(name,  data=arr)
@d-v-b
Copy link
Contributor

d-v-b commented Jan 14, 2025

I don't think create_array existed in v2, but it's true that the v2 array function took an array-like data parameter which would be used to initialize the array.

Given how many people have asked for this feature recently, I wonder if we should rename create_array to init_array, and use the name create_array for a top-level routine that combines array initialization with filling the array with data.

@jhamman
Copy link
Member

jhamman commented Jan 15, 2025

I don't see any harm in adding the data keyword to the create_array function.

@jhamman jhamman added the help wanted Issue could use help from someone with familiarity on the topic label Jan 23, 2025
@d-v-b
Copy link
Contributor

d-v-b commented Jan 24, 2025

implemented in #2761

@d-v-b d-v-b linked a pull request Jan 24, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue could use help from someone with familiarity on the topic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants