LSST Applications  22.0.1,22.0.1+01bcf6a671,22.0.1+046ee49490,22.0.1+05c7de27da,22.0.1+0c6914dbf6,22.0.1+1220d50b50,22.0.1+12fd109e95,22.0.1+1a1dd69893,22.0.1+1c910dc348,22.0.1+1ef34551f5,22.0.1+30170c3d08,22.0.1+39153823fd,22.0.1+611137eacc,22.0.1+771eb1e3e8,22.0.1+94e66cc9ed,22.0.1+9a075d06e2,22.0.1+a5ff6e246e,22.0.1+a7db719c1a,22.0.1+ba0d97e778,22.0.1+bfe1ee9056,22.0.1+c4e1e0358a,22.0.1+cc34b8281e,22.0.1+d640e2c0fa,22.0.1+d72a2e677a,22.0.1+d9a6b571bd,22.0.1+e485e9761b,22.0.1+ebe8d3385e
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.pipeline.TaskDef Class Reference

Public Member Functions

def __init__ (self, taskName, config, taskClass=None, label="")
 
str configDatasetName (self)
 
Optional[str] metadataDatasetName (self)
 
def __str__ (self)
 
bool __eq__ (self, object other)
 
def __hash__ (self)
 

Public Attributes

 taskName
 
 config
 
 taskClass
 
 label
 
 connections
 

Detailed Description

TaskDef is a collection of information about task needed by Pipeline.

The information includes task name, configuration object and optional
task class. This class is just a collection of attributes and it exposes
all of them so that attributes could potentially be modified in place
(e.g. if configuration needs extra overrides).

Attributes
----------
taskName : `str`
    `PipelineTask` class name, currently it is not specified whether this
    is a fully-qualified name or partial name (e.g. ``module.TaskClass``).
    Framework should be prepared to handle all cases.
config : `lsst.pex.config.Config`
    Instance of the configuration class corresponding to this task class,
    usually with all overrides applied. This config will be frozen.
taskClass : `type` or ``None``
    `PipelineTask` class object, can be ``None``. If ``None`` then
    framework will have to locate and load class.
label : `str`, optional
    Task label, usually a short string unique in a pipeline.

Definition at line 85 of file pipeline.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.pipeline.TaskDef.__init__ (   self,
  taskName,
  config,
  taskClass = None,
  label = "" 
)

Definition at line 108 of file pipeline.py.

108  def __init__(self, taskName, config, taskClass=None, label=""):
109  self.taskName = taskName
110  config.freeze()
111  self.config = config
112  self.taskClass = taskClass
113  self.label = label
114  self.connections = config.connections.ConnectionsClass(config=config)
115 

Member Function Documentation

◆ __eq__()

bool lsst.pipe.base.pipeline.TaskDef.__eq__ (   self,
object  other 
)

Definition at line 139 of file pipeline.py.

139  def __eq__(self, other: object) -> bool:
140  if not isinstance(other, TaskDef):
141  return False
142  # This does not consider equality of configs when determining equality
143  # as config equality is a difficult thing to define. Should be updated
144  # after DM-27847
145  return self.taskClass == other.taskClass and self.label == other.label
146 

◆ __hash__()

def lsst.pipe.base.pipeline.TaskDef.__hash__ (   self)

Definition at line 147 of file pipeline.py.

147  def __hash__(self):
148  return hash((self.taskClass, self.label))
149 
150 

◆ __str__()

def lsst.pipe.base.pipeline.TaskDef.__str__ (   self)

Definition at line 132 of file pipeline.py.

132  def __str__(self):
133  rep = "TaskDef(" + self.taskName
134  if self.label:
135  rep += ", label=" + self.label
136  rep += ")"
137  return rep
138 

◆ configDatasetName()

str lsst.pipe.base.pipeline.TaskDef.configDatasetName (   self)
Name of a dataset type for configuration of this task (`str`)

Definition at line 117 of file pipeline.py.

117  def configDatasetName(self) -> str:
118  """Name of a dataset type for configuration of this task (`str`)
119  """
120  return self.label + "_config"
121 

◆ metadataDatasetName()

Optional[str] lsst.pipe.base.pipeline.TaskDef.metadataDatasetName (   self)
Name of a dataset type for metadata of this task, `None` if
metadata is not to be saved (`str`)

Definition at line 123 of file pipeline.py.

123  def metadataDatasetName(self) -> Optional[str]:
124  """Name of a dataset type for metadata of this task, `None` if
125  metadata is not to be saved (`str`)
126  """
127  if self.config.saveMetadata:
128  return self.label + "_metadata"
129  else:
130  return None
131 

Member Data Documentation

◆ config

lsst.pipe.base.pipeline.TaskDef.config

Definition at line 111 of file pipeline.py.

◆ connections

lsst.pipe.base.pipeline.TaskDef.connections

Definition at line 114 of file pipeline.py.

◆ label

lsst.pipe.base.pipeline.TaskDef.label

Definition at line 113 of file pipeline.py.

◆ taskClass

lsst.pipe.base.pipeline.TaskDef.taskClass

Definition at line 112 of file pipeline.py.

◆ taskName

lsst.pipe.base.pipeline.TaskDef.taskName

Definition at line 109 of file pipeline.py.


The documentation for this class was generated from the following file: