From 7f85516d987c3fb49dceb1e8419c5c9503e23c11 Mon Sep 17 00:00:00 2001 From: John Parejko Date: Thu, 26 Oct 2023 15:31:37 -0700 Subject: [PATCH] Make dimension packer config optional The default config should work in most cases, so it doesn't need to be required. --- python/lsst/pipe/base/_observation_dimension_packer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/lsst/pipe/base/_observation_dimension_packer.py b/python/lsst/pipe/base/_observation_dimension_packer.py index f7cabe80f..f7727387f 100644 --- a/python/lsst/pipe/base/_observation_dimension_packer.py +++ b/python/lsst/pipe/base/_observation_dimension_packer.py @@ -74,7 +74,7 @@ class ObservationDimensionPacker(DimensionPacker): Data ID that identifies at least the ``instrument`` dimension. Must have dimension records attached unless ``config.n_detectors`` and ``config.n_visits`` are both not `None`. - config : `ObservationDimensionPackerConfig` + config : `ObservationDimensionPackerConfig`, optional Configuration for this dimension packer. is_exposure : `bool`, optional If `False`, construct a packer for visit+detector data IDs. If `True`, @@ -103,9 +103,11 @@ class ObservationDimensionPacker(DimensionPacker): def __init__( self, data_id: DataCoordinate, - config: ObservationDimensionPackerConfig, + config: ObservationDimensionPackerConfig | None = None, is_exposure: bool | None = None, ): + if config is None: + config = ObservationDimensionPackerConfig() fixed = data_id.subset(data_id.universe.extract(["instrument"])) if is_exposure is None: if "visit" in data_id.graph.names: