Skip to content

Commit

Permalink
Make dimension packer config optional
Browse files Browse the repository at this point in the history
The default config should work in most cases, so it doesn't need to be
required.
  • Loading branch information
parejkoj committed Nov 2, 2023
1 parent facbe7f commit 63641dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/lsst/pipe/base/_observation_dimension_packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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()

Check warning on line 110 in python/lsst/pipe/base/_observation_dimension_packer.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/_observation_dimension_packer.py#L110

Added line #L110 was not covered by tests
fixed = data_id.subset(data_id.universe.extract(["instrument"]))
if is_exposure is None:
if "visit" in data_id.graph.names:
Expand Down

0 comments on commit 63641dd

Please sign in to comment.