Skip to content

Commit

Permalink
Add RegistryShim class.
Browse files Browse the repository at this point in the history
This new class implements `Registry` interface and forwards all methods
to other objects. Everything is forwarded to `Butler._registry` now, but
this will change as we start refactoring ButlerRegistry implementation.
  • Loading branch information
andy-slac committed Jul 12, 2023
1 parent c0f1526 commit 96adaec
Show file tree
Hide file tree
Showing 3 changed files with 400 additions and 3 deletions.
5 changes: 4 additions & 1 deletion python/lsst/daf/butler/_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from ._dataset_existence import DatasetExistence
from ._deferredDatasetHandle import DeferredDatasetHandle
from ._limited_butler import LimitedButler
from ._registry_shim import RegistryShim
from .core import (
Config,
ConfigSubset,
Expand Down Expand Up @@ -246,6 +247,8 @@ def __init__(
if "run" in self._config or "collection" in self._config:
raise ValueError("Passing a run or collection via configuration is no longer supported.")

self._registry_shim = RegistryShim(self)

GENERATION: ClassVar[int] = 3
"""This is a Generation 3 Butler.
Expand Down Expand Up @@ -2636,7 +2639,7 @@ def registry(self) -> Registry:
are accessible only via `Registry` methods. Eventually these methods
will be replaced by equivalent `Butler` methods.
"""
return self._registry
return self._registry_shim

@property
def dimensions(self) -> DimensionUniverse:
Expand Down
Loading

0 comments on commit 96adaec

Please sign in to comment.