hdmf-dev / hdmf-zarr

Zarr I/O backend for HDMF
https://hdmf-zarr.readthedocs.io/
Other
7 stars 6 forks source link

[Feature]: Prevent Write on Containers with custom names #122

Open mavaylon1 opened 1 year ago

mavaylon1 commented 1 year ago

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

There is not catch/error for writing root containers (files) that have custom names. In order to properly write, the root container's name need to be "root".

We cannot raise a warning and rename the container due to the fact renaming a container and a builder is not allowed. Raise an error in write_builder to prevent incorrect writing.

Is your feature request related to a problem?

No response

What solution would you like?

if f_builder.name != ROOT_NAME:
            msg = f"Root builder has name {f_builder.name}. Needs to be {ROOT_NAME}."
            raise ValueError(msg)

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

mavaylon1 commented 6 months ago

I will look back into this before the next release (0.7.0)