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 | Static Public Attributes | List of all members
lsst.pipe.base.config.PipelineTaskConfig Class Reference
Inheritance diagram for lsst.pipe.base.config.PipelineTaskConfig:
lsst.pipe.base.config.PipelineTaskConfigMeta lsst.pipe.tasks.deblendCoaddSourcesPipeline.DeblendCoaddSourcesMultiConfig lsst.pipe.tasks.deblendCoaddSourcesPipeline.DeblendCoaddSourcesSingleConfig

Public Member Functions

def __new__ (cls, name, bases, dct, **kwargs)
 

Static Public Attributes

 saveMetadata
 

Detailed Description

Configuration class for `PipelineTask`

This Configuration class functions in largely the same manner as any other
derived from `lsst.pex.config.Config`. The only difference is in how it is
declared. `PipelineTaskConfig` children need to be declared with a
pipelineConnections argument. This argument should specify a child class of
`PipelineTaskConnections`. During the declaration of a `PipelineTaskConfig`
a config class is created with information from the supplied connections
class to allow configuration of the connections class. This dynamically
created config class is then attached to the `PipelineTaskConfig` via a
`~lsst.pex.config.ConfigField` with the attribute name `connections`.

Definition at line 144 of file config.py.

Member Function Documentation

◆ __new__()

def lsst.pipe.base.config.PipelineTaskConfigMeta.__new__ (   cls,
  name,
  bases,
  dct,
**  kwargs 
)
inherited

Definition at line 89 of file config.py.

89  def __new__(cls, name, bases, dct, **kwargs):
90  if name != "PipelineTaskConfig":
91  # Verify that a connection class was specified and the argument is
92  # an instance of PipelineTaskConfig
93  if 'pipelineConnections' not in kwargs:
94  for base in bases:
95  if hasattr(base, "connections"):
96  kwargs['pipelineConnections'] = base.connections.dtype.ConnectionsClass
97  break
98  if 'pipelineConnections' not in kwargs:
99  raise NameError("PipelineTaskConfig or a base class must be defined with connections class")
100  connectionsClass = kwargs['pipelineConnections']
101  if not issubclass(connectionsClass, PipelineTaskConnections):
102  raise ValueError("Can only assign a PipelineTaskConnections Class to pipelineConnections")
103 
104  # Create all the fields that will be used in the newly created sub
105  # config (under the attribute name "connections")
106  configConnectionsNamespace = {}
107  for fieldName, obj in connectionsClass.allConnections.items():
108  configConnectionsNamespace[fieldName] = pexConfig.Field(dtype=str,
109  doc=f"name for "
110  f"connection {fieldName}",
111  default=obj.name)
112  # If there are default templates also add them as fields to
113  # configure the template values
114  if hasattr(connectionsClass, 'defaultTemplates'):
115  docString = "Template parameter used to format corresponding field template parameter"
116  for templateName, default in connectionsClass.defaultTemplates.items():
117  configConnectionsNamespace[templateName] = TemplateField(dtype=str,
118  doc=docString,
119  default=default)
120  # add a reference to the connection class used to create this sub
121  # config
122  configConnectionsNamespace['ConnectionsClass'] = connectionsClass
123 
124  # Create a new config class with the fields defined above
125  Connections = type("Connections", (pexConfig.Config,), configConnectionsNamespace)
126  # add it to the Config class that is currently being declared
127  dct['connections'] = pexConfig.ConfigField(dtype=Connections,
128  doc='Configurations describing the'
129  ' connections of the PipelineTask to datatypes')
130  dct['ConnectionsConfigClass'] = Connections
131  dct['ConnectionsClass'] = connectionsClass
132  inst = super().__new__(cls, name, bases, dct)
133  return inst
134 
table::Key< int > type
Definition: Detector.cc:163

Member Data Documentation

◆ saveMetadata

lsst.pipe.base.config.PipelineTaskConfig.saveMetadata
static
Initial value:
= pexConfig.Field(
dtype=bool, default=True, optional=False,
doc="Flag to enable/disable metadata saving for a task, enabled by default.")

Definition at line 157 of file config.py.


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