Open CodyCBakerPhD opened 10 months ago
I think NWBZarrIO.file.mode
should do the trick.
io.file.mode
Traceback (most recent call last):
File ~\AppData\Roaming\Python\Python310\site-packages\zarr\hierarchy.py:520 in __getattr__
return self.__getitem__(item)
File ~\AppData\Roaming\Python\Python310\site-packages\zarr\hierarchy.py:500 in __getitem__
raise KeyError(item)
KeyError: 'mode'
Also, more to the original issue as requested by @bendichter, he wanted a universal API consistency with NWBHDF5IO in this respect
If I remember correctly not all stores in Zarr actually support mode
. The standard NestedDirectoryStore
, e.g., I believe does not have a mode
Looking at https://zarr.readthedocs.io/en/stable/api/storage.html#zarr.storage.DirectoryStore (which is what Zarr uses by default), does not have a mode
. The convenience functions zarr.convenience.open
and other have a mode
but I'm not sure right now where that is being stored (maybe, NWBZarrIO.file.store.mode
)
What would you like to see added to HDMF-ZARR?
Stems from https://github.com/catalystneuro/neuroconv/pull/569#discussion_r1342411702
The NWBHDF5IO has a
.mode
attribute publicly exposed to easily detect on an instantiated IO object what the mode was at time of instantiation (useful for determining if an in-memoryNWBFile
object was read from an existing file or created on the fly)But the NWBZarrIO does not; though the same info can be accessed via the private
._ZarrIO__mode
attributeIs your feature request related to a problem?
What solution would you like?
Expose
.mode
attribute as public instead of_ZarrIO__mode
Do you have any interest in helping implement the feature?
No.
Code of Conduct