Skip to content

Commit

Permalink
Merge pull request #894 from lsst/tickets/DM-41116
Browse files Browse the repository at this point in the history
DM-41116: Make Butler an abstract class, with DirectButler as default implementation
  • Loading branch information
andy-slac committed Oct 18, 2023
2 parents 828e697 + a5d78c2 commit 9d5d565
Show file tree
Hide file tree
Showing 41 changed files with 2,541 additions and 1,856 deletions.
3 changes: 3 additions & 0 deletions doc/changes/DM-41116.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `Butler` class becomes an abstract base class, original `Butler` was renamed to `DirectButler`.
- Clients that need an access to `DirectButler` class will have to import it from `lsst.daf.butler.direct_butler`.
- `Butler.from_config(...)` should be used to make `Butler` instances. `Butler(...)` still works and is identical to `Butler.from_config(...)`, but will generate `mypy` errors.
2,004 changes: 248 additions & 1,756 deletions python/lsst/daf/butler/_butler.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion python/lsst/daf/butler/_quantum_backed.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class QuantumProvenanceData(_BaseModelCompat):
def collect_and_transfer(
butler: Butler, quanta: Iterable[Quantum], provenance: Iterable[QuantumProvenanceData]
) -> None:
"""Transfer output datasets from multiple quanta to a more permantent
"""Transfer output datasets from multiple quanta to a more permanent
`Butler` repository.
Parameters
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/daf/butler/_registry_shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from .registry.queries import DataCoordinateQueryResults, DatasetQueryResults, DimensionRecordQueryResults

if TYPE_CHECKING:
from ._butler import Butler
from .direct_butler import DirectButler
from .registry._registry import CollectionArgType
from .registry.interfaces import ObsCoreTableManager

Expand All @@ -64,7 +64,7 @@ class RegistryShim(Registry):
Parameters
----------
butler : `Butler`
butler : `DirectButler`
Data butler instance.
Notes
Expand All @@ -75,7 +75,7 @@ class RegistryShim(Registry):
while we perform re-structuring of Registry and Butler implementations.
"""

def __init__(self, butler: Butler):
def __init__(self, butler: DirectButler):
self._butler = butler
self._registry = butler._registry

Expand Down
Loading

0 comments on commit 9d5d565

Please sign in to comment.