Skip to content

Commit 7f7329d

Browse files
authored
Merge pull request #775 from jwlodek/hdf5-rename-path-to-dataset
Rename path argument to "dataset" in hdf5_lookup
2 parents b3e47d4 + 1164d6e commit 7f7329d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Write the date in place of the "Unreleased" in the case a new version is release
1313
- Make `tiled.client` accept a Python dictionary when fed to `write_dataframe()`.
1414
- The `generated_minimal` example no longer requires pandas and instead uses a Python dict.
1515
- Remove unused pytest-warning ignores from `test_writing.py`.
16+
- Rename argument in `hdf5_lookup` function from `path` to `dataset` to reflect change in `ophyd_async`
1617

1718
### Fixed
1819
- A bug in `Context.__getstate__` caused picking to fail if applied twice.

tiled/adapters/hdf5.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def hdf5_lookup(
384384
libver: str = "latest",
385385
specs: Optional[List[Spec]] = None,
386386
access_policy: Optional[AccessPolicy] = None,
387+
dataset: Optional[Union[List[Path], List[str]]] = None,
387388
path: Optional[Union[List[Path], List[str]]] = None,
388389
) -> Union[HDF5Adapter, ArrayAdapter]:
389390
"""
@@ -397,13 +398,18 @@ def hdf5_lookup(
397398
libver :
398399
specs :
399400
access_policy :
401+
dataset :
400402
path :
401403
402404
Returns
403405
-------
404406
405407
"""
406-
path = path or []
408+
409+
if dataset is not None and path is not None:
410+
raise ValueError("dataset and path kwargs should not both be set!")
411+
412+
dataset = dataset or path or []
407413
adapter = HDF5Adapter.from_uri(
408414
data_uri,
409415
structure=structure,
@@ -413,7 +419,7 @@ def hdf5_lookup(
413419
specs=specs,
414420
access_policy=access_policy,
415421
)
416-
for segment in path:
422+
for segment in dataset:
417423
adapter = adapter.get(segment) # type: ignore
418424
if adapter is None:
419425
raise KeyError(segment)

0 commit comments

Comments
 (0)