Skip to content

Commit

Permalink
Stop using deprecated Butler constructor
Browse files Browse the repository at this point in the history
Directly calling the Butler() constructor has been deprecated because it is not compatible with mypy.  This has been replaced with Butler.from_config().
  • Loading branch information
dhirving committed Mar 4, 2024
1 parent 2d16294 commit efed055
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/data/print_registry_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def print_registry_contents(name: str) -> None:
The instrument name, which must match the registry name, e.g. "LATISS".
"""
print(f"\nregistry=instrument={name}\n")
butler = lsst.daf.butler.Butler(name, writeable=False)
butler = lsst.daf.butler.Butler.from_config(name, writeable=False)
registry = butler.registry
record_iter = registry.queryDimensionRecords(
"exposure",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_find_exposures.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def test_find_exposures_one_registry(self) -> None:
repo_path = pathlib.Path(__file__).parent / "data" / instrument

# Find all exposures in the registry, and save as a list of dicts.
butler = lsst.daf.butler.Butler(str(repo_path))
butler = lsst.daf.butler.Butler.from_config(str(repo_path))
registry = butler.registry
exposure_iter = registry.queryDimensionRecords(
"exposure",
Expand Down Expand Up @@ -395,7 +395,7 @@ async def test_find_exposures_two_registries(self) -> None:
# thus searches only return exposures from one registry.
# Use instrument=LATISS to search the second registry
# in order to test DM-33601.
butler = lsst.daf.butler.Butler(str(repo_path_2))
butler = lsst.daf.butler.Butler.from_config(str(repo_path_2))
registry = butler.registry
exposure_iter = registry.queryDimensionRecords(
"exposure",
Expand Down

0 comments on commit efed055

Please sign in to comment.