You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For context, I was trying to update the ZarrIO.load_namespaces method to accept the ZarrIO.file property as an input. I planned to update these lines below to define f = io.file if a path was not provided:
I thought the object returned from zarr.open would be the same as the one obtained from io.file. However, when trying to obtain the cached spec from the io.file object, there is no 'specifications' group in io.file and .specloc is not listed in the attrs. I think this may be because the io.file property can be set using zarr.open_consolidated, and looking at the file it seems .specloc is not saved in the consolidated metadata.
I wasn't sure if this was actually a bug or I may be misunderstanding how the consolidated metadata should work.
Steps to Reproduce
importzarrfrompynwb.testing.mock.ecephysimportmock_Device, mock_ElectrodeGroup, mock_ElectrodeTablefrompynwb.testing.mock.fileimportmock_NWBFilefromhdmf.commonimportDynamicTableRegionfromhdmf_zarr.nwbimportNWBZarrIO# create nwb filedevice=mock_Device()
group=mock_ElectrodeGroup(device=device)
electrodes_table=mock_ElectrodeTable(group=group)
electrodes=DynamicTableRegion(name="electrodes", data=list(range(5)), table=electrodes_table, description="electrodes")
nwbfile=mock_NWBFile(electrode_groups=[group],
electrodes=electrodes_table,
devices=[device])
path="zarr_testing.nwb.zarr"withNWBZarrIO(path=path, mode="w") asio:
io.write(nwbfile)
withNWBZarrIO(path=path, mode="r") asio:
# group from io.fileprint(f'{io.file.attrs.keys() =}')
# group from zarr.openf=zarr.open(path, mode='r')
print(f'{f.attrs.keys() =}')
# group from zarr.open_consolidatedf=zarr.open_consolidated(path, mode='r')
print(f'{f.attrs.keys() =}')
What happened?
For context, I was trying to update the
ZarrIO.load_namespaces
method to accept theZarrIO.file
property as an input. I planned to update these lines below to definef = io.file
if a path was not provided:hdmf-zarr/src/hdmf_zarr/backend.py
Lines 238 to 243 in 8376fe4
I thought the object returned from
zarr.open
would be the same as the one obtained fromio.file
. However, when trying to obtain the cached spec from theio.file
object, there is no 'specifications' group inio.file
and.specloc
is not listed in the attrs. I think this may be because theio.file
property can be set usingzarr.open_consolidated
, and looking at the file it seems.specloc
is not saved in the consolidated metadata.I wasn't sure if this was actually a bug or I may be misunderstanding how the consolidated metadata should work.
Steps to Reproduce
Traceback
Operating System
macOS
Python Executable
Conda
Python Version
3.11
Package Versions
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: