Skip to content

Commit

Permalink
Add aws_region to HDF5IO.load_namespaces calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored May 18, 2024
1 parent 7979705 commit 9f92f23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pynwb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions src/pynwb/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 9f92f23

Please sign in to comment.