@@ -46,14 +46,14 @@ def load_type_config(**kwargs):
4646 This method will either load the default config or the config provided by the path.
4747 """
4848 config_path = kwargs ['config_path' ]
49- type_map = kwargs ['type_map' ] or get_type_map ()
49+ type_map = kwargs ['type_map' ] or __TYPE_MAP
5050
5151 hdmf_load_type_config (config_path = config_path , type_map = type_map )
5252
5353@docval ({'name' : 'type_map' , 'type' : TypeMap , 'doc' : 'The TypeMap.' , 'default' : None },
5454 is_method = False )
5555def get_loaded_type_config (** kwargs ):
56- type_map = kwargs ['type_map' ] or get_type_map ()
56+ type_map = kwargs ['type_map' ] or __TYPE_MAP
5757 return hdmf_get_loaded_type_config (type_map = type_map )
5858
5959@docval ({'name' : 'type_map' , 'type' : TypeMap , 'doc' : 'The TypeMap.' , 'default' : None },
@@ -62,7 +62,7 @@ def unload_type_config(**kwargs):
6262 """
6363 Remove validation.
6464 """
65- type_map = kwargs ['type_map' ] or get_type_map ()
65+ type_map = kwargs ['type_map' ] or __TYPE_MAP
6666 hdmf_unload_type_config (type_map = type_map )
6767
6868def __get_resources () -> dict :
@@ -113,6 +113,7 @@ def get_type_map(**kwargs):
113113 if extensions is None :
114114 type_map = deepcopy (__TYPE_MAP )
115115 else :
116+ warnings .warn ("The 'extensions' argument is deprecated and will be removed in HDMF 5.0" , DeprecationWarning )
116117 if isinstance (extensions , TypeMap ):
117118 type_map = extensions
118119 else :
@@ -538,7 +539,7 @@ def read_nwb(**kwargs):
538539 # Retrieve the filepath
539540 path = popargs ('path' , kwargs )
540541 file = popargs ('file' , kwargs )
541-
542+
542543 path = str (path ) if path is not None else None
543544
544545 # Streaming case
@@ -556,18 +557,18 @@ def read_nwb(**kwargs):
556557
557558 return nwbfile
558559
559- @docval ({'name' : 'path' , 'type' : (str , Path ),
560+ @docval ({'name' : 'path' , 'type' : (str , Path ),
560561 'doc' : 'Path to the NWB file. Can be either a local filesystem path to '
561- 'an HDF5 (.nwb) or Zarr (.zarr) file.' },
562+ 'an HDF5 (.nwb) or Zarr (.zarr) file.' },
562563 is_method = False )
563564def read_nwb (** kwargs ):
564565 """Read an NWB file from a local path.
565566
566- High-level interface for reading NWB files. Automatically handles both HDF5
567- and Zarr formats. For advanced use cases (parallel I/O, custom namespaces),
567+ High-level interface for reading NWB files. Automatically handles both HDF5
568+ and Zarr formats. For advanced use cases (parallel I/O, custom namespaces),
568569 use NWBHDF5IO or NWBZarrIO.
569570
570- See also
571+ See also
571572 * :py:class:`~pynwb.NWBHDF5IO`: Core I/O class for HDF5 files with advanced options.
572573 * :py:class:`~hdmf_zarr.nwb.NWBZarrIO`: Core I/O class for Zarr files with advanced options.
573574
@@ -585,17 +586,17 @@ def read_nwb(**kwargs):
585586 * Write or append modes
586587 * Pre-opened HDF5 file objects or Zarr stores
587588 * Remote file access configuration
588-
589+
589590 Example usage reading a local NWB file:
590591
591592 .. code-block:: python
592593
593594 from pynwb import read_nwb
594- nwbfile = read_nwb("path/to/file.nwb")
595+ nwbfile = read_nwb("path/to/file.nwb")
595596
596597 :Returns: pynwb.NWBFile The loaded NWB file object.
597598 """
598-
599+
599600 path = popargs ('path' , kwargs )
600601 # HDF5 is always available so we try that first
601602 backend_is_hdf5 = NWBHDF5IO .can_read (path = path )
@@ -607,18 +608,18 @@ def read_nwb(**kwargs):
607608 from hdmf_zarr import NWBZarrIO
608609 backend_is_zarr = NWBZarrIO .can_read (path = path )
609610 if backend_is_zarr :
610- return NWBZarrIO .read_nwb (path = path )
611+ return NWBZarrIO .read_nwb (path = path )
611612 else :
612613 raise ValueError (
613614 f"Unable to read file: '{ path } '. The file is not recognized as "
614615 "either a valid HDF5 or Zarr NWB file. Please ensure the file exists and contains valid NWB data."
615- )
616+ )
616617 except ImportError :
617618 raise ValueError (
618619 f"Unable to read file: '{ path } '. The file is not recognized as an HDF5 NWB file. "
619620 "If you are trying to read a Zarr file, please install hdmf-zarr using: pip install hdmf-zarr"
620621 )
621-
622+
622623
623624
624625from . import io as __io # noqa: F401,E402
@@ -642,7 +643,7 @@ def read_nwb(**kwargs):
642643 # Functions
643644 'get_type_map' ,
644645 'get_manager' ,
645- 'load_namespaces' ,
646+ 'load_namespaces' ,
646647 'available_namespaces' ,
647648 'clear_cache_dir' ,
648649 'register_class' ,
@@ -653,11 +654,11 @@ def read_nwb(**kwargs):
653654 'unload_type_config' ,
654655 'read_nwb' ,
655656 'get_nwbfile_version' ,
656-
657+
657658 # Classes
658659 'NWBHDF5IO' ,
659660 'NWBContainer' ,
660- 'NWBData' ,
661+ 'NWBData' ,
661662 'TimeSeries' ,
662663 'ProcessingModule' ,
663664 'NWBFile' ,
0 commit comments