Skip to content

Commit

Permalink
Merge pull request #346 from lsst/tickets/DM-39760
Browse files Browse the repository at this point in the history
DM-39760: Make NoDimensionsTask test utility consistent about storage classes.
  • Loading branch information
TallJimbo authored Jun 23, 2023
2 parents f9b488b + cf2b212 commit edb96d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/lsst/pipe/base/tests/no_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"NoDimensionsTestTask",
)

import dataclasses
from typing import cast

from lsst.pex.config import Field
Expand All @@ -51,13 +52,19 @@ class NoDimensionsTestConnections(PipelineTaskConnections, dimensions=set()):
name="output", doc="some dict-y output data for testing", storageClass="StructuredDataDict"
)

config: NoDimensionsTestConfig

def __init__(self, *, config: PipelineTaskConfig | None = None):
if self.config.outputSC != "StructuredDataDict":
self.output = dataclasses.replace(self.output, storageClass=self.config.outputSC)


class NoDimensionsTestConfig(PipelineTaskConfig, pipelineConnections=NoDimensionsTestConnections):
"""Configuration for `NoDimensionTestTask`."""

key = Field[str](doc="String key for the dict entry the task sets.", default="one")
value = Field[int](doc="Integer value for the dict entry the task sets.", default=1)
outputSC = Field[str](doc="Output storage class requested", default="dict")
outputSC = Field[str](doc="Output storage class requested", default="StructuredDataDict")


class NoDimensionsTestTask(PipelineTask):
Expand Down

0 comments on commit edb96d1

Please sign in to comment.