hdmf_zarr.nwb module

Module with Zarr backend for NWB for integration with PyNWB

class hdmf_zarr.nwb.NWBZarrIO(path, mode, manager=None, synchronizer=None, object_codec_class=None, storage_options=None, force_overwrite=False, load_namespaces=True, extensions=None)

Bases: ZarrIO

IO backend for PyNWB for writing NWB files

This class is similar to the NWBHDF5IO class in PyNWB. The main purpose of this class is to perform default setup for BuildManager, loading or namespaces etc., in the context of the NWB format.

Parameters:
  • path (str or Path or DirectoryStore or TempStore or NestedDirectoryStore) – the path to the Zarr file or a supported Zarr store

  • mode (str) – the mode to open the Zarr file with, one of (“w”, “r”, “r+”, “a”, “r-“). the mode r- is used to force open without consolidated metadata in read only mode.

  • manager (BuildManager) – the BuildManager to use for I/O

  • synchronizer (ProcessSynchronizer or ThreadSynchronizer or bool) – Zarr synchronizer to use for parallel I/O. If set to True a ProcessSynchronizer is used.

  • object_codec_class (None) – Set the numcodec object codec class to be used to encode objects.Use numcodecs.pickles.Pickle by default.

  • storage_options (dict) – Zarr storage options to read remote folders

  • force_overwrite (bool) – force overwriting existing object when in ‘w’ mode. The existing file or directory will be deleted when before opening (even if the object is not Zarr, e.g,. an HDF5 file)

  • load_namespaces (bool) – whether or not to load cached namespaces from given path - not applicable in write mode

  • extensions (str or TypeMap or list) – a path to a namespace, a TypeMap, or a list consisting paths to namespaces and TypeMaps

export(src_io, nwbfile=None, write_args={})
Parameters:
  • src_io (HDMFIO) – the HDMFIO object for reading the data to export

  • nwbfile (NWBFile) – the NWBFile object to export. If None, then the entire contents of src_io will be exported

  • write_args (dict) – arguments to pass to write_builder()

static read_nwb(path)

Helper factory method for reading an NWB file and return the NWBFile object

Parameters:

path (str or Path or DirectoryStore or TempStore or NestedDirectoryStore) – the path to the Zarr file or a supported Zarr store