Adding attrs arg to create_group and create_dataset
See original GitHub issueAs it stands now, when one writes a group or dataset, one must write the attributes as a separate operation. This results in creation of .zattrs
once. Then if one update the attributes, it results in writing .zattrs
again. With something like a ZipStore
backed Zarr Group, one gets a warning on writing .zattrs
the second time, which AFAICT is unavoidable unless someone sets the attributes correctly the first time. So if we include an argument for attrs
to create_group
and create_dataset
, we should be able to avoid this warning by setting the attributes during creation of these Zarr objects.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
netCDF4 API documentation
Dataset.createGroup takes a single argument, a python string containing the name of the new group. The new Group instances contained within the ...
Read more >attrs by Example - attrs 22.2.0 documentation
If you create an attribute with init=False , the kw_only argument is ignored. Keyword-only attributes allow subclasses to add attributes without default ...
Read more >h5fortran/Examples.md at main · geospace-code ... - GitHub
Create dataset with fill value ... By default a dataset has arbitrary data. Providing a fill value initializes the dataset to that value,...
Read more >Create a Dataset Using a Web Service - Oracle Help Center
On the Data Model pane, select Parameters, click Create New Parameter, and define the parameters to make them available to the web service...
Read more >hdf5r: Interface to the 'HDF5' Binary Data Format
Additionally, functionality is added so that 'HDF5' objects behave very ... createGroup Maps to object$create_group where object implements CommonFG.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thinking about this some more, I actually think the current behaviour is a bit pointless: when an array or group is created, an empty dict is written to the .zattrs key, but there is no need to write .zattrs at all unless the user actually wants to store some attributes. I’m tempted to change this so that .zattrs is only written when the user actually wants to store some attributes. This would obviate the need for an ‘attrs’ argument to array or group creation, because, e.g.:
…would then imply only a single write to .zattrs.
I’ve gone ahead and implemented this in #200, everything works fine and should be fully backwards compatible with code and data, so seems like a good thing to me.