Skip to content

[Feature]: Write scalar datasets with shape () #309

Description

@rly

What would you like to see added to HDMF-ZARR?

See #284 and

dset = parent.require_dataset(name, shape=(1,), dtype=dtype, **io_settings)

Zarr v2 supports writing arrays with shape None (or ()). This is consistent with HDF5IO:
https://github.com/hdmf-dev/hdmf/blob/a90f8ed0588fcdd84d4af1d693e851099ced6066/src/hdmf/backends/hdf5/h5tools.py#L1278

We should do the same with ZarrIO. Doing this will remove a special handling case, and remove a deviation between HDF5IO and ZarrIO as we look to merge it into core HDMF.

Is your feature request related to a problem?

This would simplify the resolution of #277.

What solution would you like?

Use shape () and stop writing the attribute zarr_dtype=scalar but keep processing it on read in case it is present.

Do you have any interest in helping implement the feature?

Yes.

Metadata

Metadata

Assignees

Labels

category: enhancementimprovements of code or code behaviorpriority: lowalternative solution already working and/or relevant to only specific user(s)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions