Skip to content

Commit

Permalink
Merge pull request #262 from lsst/tickets/DM-38687
Browse files Browse the repository at this point in the history
DM-38687: Remove deprecated ExposureIdInfo support code.
  • Loading branch information
TallJimbo committed Jan 4, 2024
2 parents 025927a + 0d9a048 commit 08a116f
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions python/lsst/meas/base/_id_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import numpy as np
from lsst.afw.table import IdFactory, Schema, SourceCatalog, SourceTable
from lsst.daf.butler import DataCoordinate, DimensionPacker
from lsst.obs.base import ExposureIdInfo
from lsst.pex.config import Config, ConfigField, Field
from lsst.pipe.base import Instrument
from lsst.skymap.packers import SkyMapDimensionPacker
Expand Down Expand Up @@ -281,21 +280,6 @@ def runQuantum(self, ..., data_id: DataCoordinate):
:ref:`lsst.meas.base-generating-source-and-object-ids`
"""

# TODO: remove this method on DM-38687.
# No deprecation decorator here because the type this method accepts is
# itself deprecated, so it's only going to be called by code paths that
# will go away when the deprecation turns into a removal, and which already
# warn.
@staticmethod
def _from_exposure_id_info(exposure_id_info: ExposureIdInfo) -> IdGenerator:
"""Construct a new ID generator from the object this class supersedes.
This method is deprecated along with the type it accepts; it's provided
only as a temporary helper to aid in the transition from
`lsst.obs.base.ExposureIdInfo` to `IdGenerator`.
"""
return _ExposureIdInfoIdGenerator(exposure_id_info)

@property
def catalog_id(self) -> int:
"""The integer identifier for the full catalog with this data ID, not
Expand Down Expand Up @@ -535,35 +519,3 @@ def __post_init__(self) -> None:
upper_bits = (self.n_releases - 1).bit_length() + self.packer.maxBits
self.counter_bits = IdFactory.computeReservedFromMaxBits(upper_bits)
self.n_counters = 1 << self.counter_bits


# TODO: remove this method on DM-38687.
# No deprecation decorator here because the type this class holds is itself
# deprecated, so it's only going to be called by code paths that will go away
# when the deprecation turns into a removal, and which already warn.
class _ExposureIdInfoIdGenerator(IdGenerator):
"""A `IdGenerator` implementation to aid in the transition from
`lsst.obs.base.ExposureIdInfo`.
"""

def __init__(self, exposure_id_info: ExposureIdInfo):
self._exposure_id_info = exposure_id_info

@property
def catalog_id(self) -> int:
# Docstring inherited.
return self._exposure_id_info.expId

def __str__(self) -> str:
return str(self.catalog_id)

def make_table_id_factory(self) -> IdFactory:
# Docstring inherited.
return self._exposure_id_info.makeSourceIdFactory()

def arange(self, *args, **kwargs) -> np.ndarray:
# Docstring inherited.
raise NotImplementedError(
"This IdGenerator implementation does not support arange; "
"please update to IdGenerator.from_config for a full-featured implementation."
)

0 comments on commit 08a116f

Please sign in to comment.