Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-39760: Make NoDimensionsTask test utility consistent about storage classes. #346

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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