From 9f92f234946cf544850dad7e31c56bc2040dcf10 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 17 May 2024 19:11:29 -0700 Subject: [PATCH] Add aws_region to HDF5IO.load_namespaces calls --- src/pynwb/__init__.py | 2 +- src/pynwb/validate.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pynwb/__init__.py b/src/pynwb/__init__.py index 10efc6fe2..ada39764e 100644 --- a/src/pynwb/__init__.py +++ b/src/pynwb/__init__.py @@ -266,7 +266,7 @@ def __init__(self, **kwargs): if load_namespaces: tm = get_type_map() - super().load_namespaces(tm, path, file=file_obj, driver=driver) + super().load_namespaces(tm, path, file=file_obj, driver=driver, aws_region=aws_region) manager = BuildManager(tm) # XXX: Leaving this here in case we want to revert to this strategy for diff --git a/src/pynwb/validate.py b/src/pynwb/validate.py index 827249cbb..aecfb2556 100644 --- a/src/pynwb/validate.py +++ b/src/pynwb/validate.py @@ -30,7 +30,7 @@ def _validate_helper(io: HDMFIO, namespace: str = CORE_NAMESPACE) -> list: def _get_cached_namespaces_to_validate( - path: str, driver: Optional[str] = None + path: str, driver: Optional[str] = None, aws_region: Optional[str] = None, ) -> Tuple[List[str], BuildManager, Dict[str, str]]: """ Determine the most specific namespace(s) that are cached in the given NWBFile that can be used for validation. @@ -58,7 +58,12 @@ def _get_cached_namespaces_to_validate( catalog = NamespaceCatalog( group_spec_cls=NWBGroupSpec, dataset_spec_cls=NWBDatasetSpec, spec_namespace_cls=NWBNamespace ) - namespace_dependencies = NWBHDF5IO.load_namespaces(namespace_catalog=catalog, path=path, driver=driver) + namespace_dependencies = NWBHDF5IO.load_namespaces( + namespace_catalog=catalog, + path=path, + driver=driver, + aws_region=aws_region + ) # Determine which namespaces are the most specific (i.e. extensions) and validate against those candidate_namespaces = set(namespace_dependencies.keys())