diff --git a/python/lsst/daf/butler/registry/obscore/_manager.py b/python/lsst/daf/butler/registry/obscore/_manager.py index fc3c36a600..284f4281d5 100644 --- a/python/lsst/daf/butler/registry/obscore/_manager.py +++ b/python/lsst/daf/butler/registry/obscore/_manager.py @@ -47,7 +47,7 @@ from ..interfaces import ObsCoreTableManager, VersionTuple from ..queries import SqlQueryContext from ._config import ConfigCollectionType, ObsCoreManagerConfig -from ._records import ExposureRegionFactory, Record, RecordFactory +from ._records import DerivedRegionFactory, Record, RecordFactory from ._schema import ObsCoreSchema from ._spatial import RegionTypeError, RegionTypeWarning, SpatialObsCorePlugin @@ -63,7 +63,7 @@ _VERSION = VersionTuple(0, 0, 1) -class _ExposureRegionFactory(ExposureRegionFactory): +class _ExposureRegionFactory(DerivedRegionFactory): """Find exposure region from a matching visit dimensions records. Parameters @@ -79,7 +79,7 @@ def __init__(self, dimensions: DimensionRecordStorageManager, context: SqlQueryC self.exposure_detector_dimensions = self.universe.conform(["exposure", "detector"]) self._context = context - def exposure_region(self, dataId: DataCoordinate) -> Region | None: + def derived_region(self, dataId: DataCoordinate) -> Region | None: # Docstring is inherited from a base class. context = self._context # Make a relation that starts with visit_definition (mapping between diff --git a/python/lsst/daf/butler/registry/obscore/_records.py b/python/lsst/daf/butler/registry/obscore/_records.py index c7cdd4de20..81a52b5c90 100644 --- a/python/lsst/daf/butler/registry/obscore/_records.py +++ b/python/lsst/daf/butler/registry/obscore/_records.py @@ -27,7 +27,7 @@ from __future__ import annotations -__all__ = ["ExposureRegionFactory", "Record", "RecordFactory"] +__all__ = ["DerivedRegionFactory", "Record", "RecordFactory"] import logging import warnings @@ -63,17 +63,17 @@ } -class ExposureRegionFactory: - """Abstract interface for a class that returns a Region for an exposure.""" +class DerivedRegionFactory: + """Abstract interface for a class that returns a Region for a data ID.""" @abstractmethod - def exposure_region(self, dataId: DataCoordinate) -> Region | None: - """Return a region for a given DataId that corresponds to an exposure. + def derived_region(self, dataId: DataCoordinate) -> Region | None: + """Return a region for a given DataId that may have been derived. Parameters ---------- dataId : `DataCoordinate` - Data ID for an exposure dataset. + Data ID for the relevant dataset. Returns ------- @@ -99,7 +99,7 @@ class RecordFactory: Registry dimensions universe. spatial_plugins : `~collections.abc.Collection` of `SpatialObsCorePlugin` Spatial plugins. - exposure_region_factory : `ExposureRegionFactory`, optional + derived_region_factory : `DerivedRegionFactory`, optional Manager for Registry dimensions. """ @@ -109,12 +109,12 @@ def __init__( schema: ObsCoreSchema, universe: DimensionUniverse, spatial_plugins: Collection[SpatialObsCorePlugin], - exposure_region_factory: ExposureRegionFactory | None = None, + derived_region_factory: DerivedRegionFactory | None = None, ): self.config = config self.schema = schema self.universe = universe - self.exposure_region_factory = exposure_region_factory + self.derived_region_factory = derived_region_factory self.spatial_plugins = spatial_plugins # All dimension elements used below. @@ -360,7 +360,7 @@ class DafButlerRecordFactory(RecordFactory): Registry dimensions universe. spatial_plugins : `~collections.abc.Collection` of `SpatialObsCorePlugin` Spatial plugins. - exposure_region_factory : `ExposureRegionFactory`, optional + derived_region_factory : `DerivedRegionFactory`, optional Manager for Registry dimensions. """ @@ -370,14 +370,14 @@ def __init__( schema: ObsCoreSchema, universe: DimensionUniverse, spatial_plugins: Collection[SpatialObsCorePlugin], - exposure_region_factory: ExposureRegionFactory | None = None, + derived_region_factory: DerivedRegionFactory | None = None, ): super().__init__( config=config, schema=schema, universe=universe, spatial_plugins=spatial_plugins, - exposure_region_factory=exposure_region_factory, + derived_region_factory=derived_region_factory, ) # All dimension elements used below. @@ -411,8 +411,8 @@ def make_universe_records(self, ref: DatasetRef) -> Record: if self.exposure.name in dataId: if (dimension_record := dataId.records[self.exposure.name]) is not None: self._exposure_records(dimension_record, record) - if self.exposure_region_factory is not None: - region = self.exposure_region_factory.exposure_region(dataId) + if self.derived_region_factory is not None: + region = self.derived_region_factory.derived_region(dataId) elif self.visit.name in dataId and (dimension_record := dataId.records[self.visit.name]) is not None: self._visit_records(dimension_record, record)