Skip to content

Commit

Permalink
Make metadata dataset type name formula available as classmethod.
Browse files Browse the repository at this point in the history
We don't want to force a TaskDef to be constructed in order to get at
this.
  • Loading branch information
TallJimbo committed Mar 14, 2022
1 parent 92bab86 commit 4e9bf2a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion python/lsst/pipe/base/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,26 @@ def metadataDatasetName(self) -> Optional[str]:
metadata is not to be saved (`str`)
"""
if self.config.saveMetadata:
return self.label + "_metadata"
return self.makeMetadataDatasetName(self.label)
else:
return None

@classmethod
def makeMetadataDatasetName(cls, label: str) -> str:
"""Construct the name of the dataset type for metadata for a task.
Parameters
----------
label : `str`
Label for the task within its pipeline.
Returns
-------
name : `str`
Name of the task's metadata dataset type.
"""
return label + "_metadata"

@property
def logOutputDatasetName(self) -> Optional[str]:
"""Name of a dataset type for log output from this task, `None` if
Expand Down

0 comments on commit 4e9bf2a

Please sign in to comment.