Skip to content

Commit

Permalink
add condition for ros3 validation
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Dec 16, 2024
1 parent d2f7561 commit 11cc232
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/pynwb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 362 in src/pynwb/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/pynwb/__init__.py#L362

Added line #L362 was not covered by tests

try:
from hdmf_zarr import NWBZarrIO
backend_io_classes = [NWBHDF5IO, NWBZarrIO]

Check warning on line 366 in src/pynwb/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/pynwb/__init__.py#L366

Added line #L366 was not covered by tests
Expand Down
4 changes: 2 additions & 2 deletions src/pynwb/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 11cc232

Please sign in to comment.