Skip to content

Commit

Permalink
Merge pull request #775 from jwlodek/hdf5-rename-path-to-dataset
Browse files Browse the repository at this point in the history
Rename path argument to "dataset" in hdf5_lookup
  • Loading branch information
jwlodek committed Aug 9, 2024
2 parents b3e47d4 + 1164d6e commit 7f7329d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Write the date in place of the "Unreleased" in the case a new version is release
- Make `tiled.client` accept a Python dictionary when fed to `write_dataframe()`.
- The `generated_minimal` example no longer requires pandas and instead uses a Python dict.
- Remove unused pytest-warning ignores from `test_writing.py`.
- Rename argument in `hdf5_lookup` function from `path` to `dataset` to reflect change in `ophyd_async`

### Fixed
- A bug in `Context.__getstate__` caused picking to fail if applied twice.
Expand Down
10 changes: 8 additions & 2 deletions tiled/adapters/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ def hdf5_lookup(
libver: str = "latest",
specs: Optional[List[Spec]] = None,
access_policy: Optional[AccessPolicy] = None,
dataset: Optional[Union[List[Path], List[str]]] = None,
path: Optional[Union[List[Path], List[str]]] = None,
) -> Union[HDF5Adapter, ArrayAdapter]:
"""
Expand All @@ -397,13 +398,18 @@ def hdf5_lookup(
libver :
specs :
access_policy :
dataset :
path :
Returns
-------
"""
path = path or []

if dataset is not None and path is not None:
raise ValueError("dataset and path kwargs should not both be set!")

dataset = dataset or path or []
adapter = HDF5Adapter.from_uri(
data_uri,
structure=structure,
Expand All @@ -413,7 +419,7 @@ def hdf5_lookup(
specs=specs,
access_policy=access_policy,
)
for segment in path:
for segment in dataset:
adapter = adapter.get(segment) # type: ignore
if adapter is None:
raise KeyError(segment)
Expand Down

0 comments on commit 7f7329d

Please sign in to comment.