Skip to content

Commit

Permalink
Add label->task mapping and description properties to Pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo authored and timj committed Sep 27, 2023
1 parent 76003a3 commit 8b7eda6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/lsst/pipe/base/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,20 @@ def __eq__(self, other: object) -> bool:
"Pipelines cannot be compared because config instances cannot be compared; see DM-27847."
)

@property
def tasks(self) -> Mapping[str, str]:
"""A mapping from label to the name of the associated task class.
This never imports task classes or configuration, but as a result it
may not return labels in the same order as iteration over the pipeline.
"""
return {t.label: t.klass for t in self._pipelineIR.tasks.values()}

@property
def description(self) -> str:
"""The string description of the pipeline."""
return self._pipelineIR.description


@dataclass(frozen=True)
class TaskDatasetTypes:
Expand Down

0 comments on commit 8b7eda6

Please sign in to comment.