diff --git a/docs/gallery/general/plot_read_basics.py b/docs/gallery/general/plot_read_basics.py index be40ede40..b13888ee0 100644 --- a/docs/gallery/general/plot_read_basics.py +++ b/docs/gallery/general/plot_read_basics.py @@ -108,8 +108,9 @@ nwbfile ####################################### -# For more advance use, use the :py:class:`~pynwb.NWBHDF5IO`. Here, we show how it can be used as a context manager -# to read data from an NWB file in a more controlled way: +# For more advanced use cases, the :py:class:~pynwb.NWBHDF5IO class provides additional functionality. +# Below, we demonstrate how :py:class:~pynwb.NWBHDF5IO can be used as a context manager +# to read data from an NWB file in a more controlled manner: from pynwb import NWBHDF5IO with NWBHDF5IO(filepath, mode="r") as io2: diff --git a/src/pynwb/__init__.py b/src/pynwb/__init__.py index 98d95002a..e8f2540b0 100644 --- a/src/pynwb/__init__.py +++ b/src/pynwb/__init__.py @@ -540,9 +540,9 @@ def read_nwb(**kwargs): def read_nwb(**kwargs): """Read an NWB file from a local path or remote URL. - Provides a simple, high-level interface for reading NWB files in the most - common use cases. Automatically handles both HDF5 and Zarr formats. - For advanced use cases (parallel I/O, custom namespaces), use NWBHDF5IO or NWBZarrIO. + High-level interface for reading NWB files. Automatically handles both HDF5 + and Zarr formats. For advanced use cases (parallel I/O, custom namespaces), + use NWBHDF5IO or NWBZarrIO. Parameters ---------- @@ -566,7 +566,6 @@ def read_nwb(**kwargs): * Always opens in read-only mode * Automatically loads namespaces * Detects file format based on extension - * Automatically handles local and remote paths Advanced features requiring direct use of IO classes include: * Streaming data from s3 diff --git a/tests/integration/hdf5/test_io.py b/tests/integration/hdf5/test_io.py index 545b590de..f17a7217a 100644 --- a/tests/integration/hdf5/test_io.py +++ b/tests/integration/hdf5/test_io.py @@ -613,6 +613,7 @@ def test_read_nwb_method_file(self): io.write(self.nwbfile) import h5py + file = h5py.File(self.path, 'r') read_nwbfile = NWBHDF5IO.read_nwb(file=file) @@ -626,7 +627,4 @@ def test_read_nwb_method_s3_path(self): read_nwbfile = NWBHDF5IO.read_nwb(path=s3_test_path) assert read_nwbfile.identifier == "3f77c586-6139-4777-a05d-f603e90b1330" - assert read_nwbfile.subject.subject_id == "1" - - - + assert read_nwbfile.subject.subject_id == "1" \ No newline at end of file