diff --git a/src/pynwb/__init__.py b/src/pynwb/__init__.py index 6ccce7ee8..37779a2bc 100644 --- a/src/pynwb/__init__.py +++ b/src/pynwb/__init__.py @@ -355,8 +355,12 @@ def get_sum(self, a, b): @docval({'name': 'path', 'type': str, 'doc': 'the neurodata_type to get the NWBContainer class for'}, + {"name": "method", "type": str, "doc": "the method to use when opening the file", 'default': None}, is_method=False) -def _get_backend(path: str): +def _get_backend(path: str, method: str = None): + if method == "ros3": + return NWBHDF5IO # TODO - add additional conditions for other streaming methods + try: from hdmf_zarr import NWBZarrIO backend_io_classes = [NWBHDF5IO, NWBZarrIO] diff --git a/src/pynwb/validation.py b/src/pynwb/validation.py index 583f23682..01b62627d 100644 --- a/src/pynwb/validation.py +++ b/src/pynwb/validation.py @@ -61,7 +61,7 @@ def get_cached_namespaces_to_validate(path: Optional[str] = None, file=io._file) else: from pynwb import _get_backend - backend_io = _get_backend(path) + backend_io = _get_backend(path, method=driver) namespace_dependencies = backend_io.load_namespaces(namespace_catalog=catalog, path=path, driver=driver, @@ -164,7 +164,7 @@ def validate(**kwargs): # get io object if not provided if path is not None: from pynwb import _get_backend - backend_io = _get_backend(path) + backend_io = _get_backend(path, method=driver) io = backend_io(**io_kwargs) # check namespaces are accurate