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

attrs as kwarg #538

Closed
d-v-b opened this issue Feb 21, 2020 · 2 comments
Closed

attrs as kwarg #538

d-v-b opened this issue Feb 21, 2020 · 2 comments
Labels
help wanted Issue could use help from someone with familiarity on the topic
Milestone

Comments

@d-v-b
Copy link
Contributor

d-v-b commented Feb 21, 2020

Is there any reason why it's not possible to set the attrs of an array / group by passing a kwarg to the relevant creation function? e.g.:

z = zarr.create((10,10),chunks=(1,1), attrs={'foo':10})

(The current behavior is to ignore the attrs kwarg)
Looking back in time, I see this discussion: #121. It seems attrs as a kwarg was not pursued because of concerns about matching the behavior of hdf5? How relevant is that concern today>

@alimanfoo
Copy link
Member

Hi @d-v-b, sorry you didn't get a reply to this at the time.

#121 got closed because the original complaint was that '.zattrs' got written twice when you create an array then set attributes. We resolved that by modifying the library so that '.zattrs' was created lazily the first time the user tried to write some attributes.

However I can see that it would be convenient to also support attrs in the array creation functions, so no objection from me to adding support for that.

@joshmoore joshmoore added the help wanted Issue could use help from someone with familiarity on the topic label Dec 13, 2022
@d-v-b d-v-b mentioned this issue Dec 15, 2022
@jhamman
Copy link
Member

jhamman commented Aug 15, 2024

this is done as part of the 3.0 release. Coming soon :).

@jhamman jhamman closed this as completed Aug 15, 2024
@jhamman jhamman added this to the 3.0.0 milestone Aug 15, 2024
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
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants