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.pipelineIR.TaskIR Class Reference

Public Member Functions

Dict[str, Union[str, List[dict]]] to_primitives (self)
 
def add_or_update_config (self, ConfigIR other_config)
 
def __eq__ (self, object other)
 

Public Attributes

 config
 

Detailed Description

Intermediate representation of tasks read from a pipeline yaml file.

Definition at line 327 of file pipelineIR.py.

Member Function Documentation

◆ __eq__()

def lsst.pipe.base.pipelineIR.TaskIR.__eq__ (   self,
object  other 
)

Definition at line 369 of file pipelineIR.py.

369  def __eq__(self, other: object):
370  if not isinstance(other, TaskIR):
371  return False
372  elif all(getattr(self, attr) == getattr(other, attr) for attr in
373  ("label", "klass", "config")):
374  return True
375  else:
376  return False
377 
378 
379 @dataclass
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.

◆ add_or_update_config()

def lsst.pipe.base.pipelineIR.TaskIR.add_or_update_config (   self,
ConfigIR  other_config 
)
Adds a `ConfigIR` to this task if one is not present. Merges configs
if there is a `ConfigIR` present and the dataId keys of both configs
match, otherwise adds a new entry to the config list. The exception to
the above is that if either the last config or other_config has a
python block, then other_config is always added, as python blocks can
modify configs in ways that cannot be predicted.

Parameters
----------
other_config : `ConfigIR`
    A `ConfigIR` instance to add or merge into the config attribute of
    this task.

Definition at line 350 of file pipelineIR.py.

350  def add_or_update_config(self, other_config: ConfigIR):
351  """Adds a `ConfigIR` to this task if one is not present. Merges configs
352  if there is a `ConfigIR` present and the dataId keys of both configs
353  match, otherwise adds a new entry to the config list. The exception to
354  the above is that if either the last config or other_config has a
355  python block, then other_config is always added, as python blocks can
356  modify configs in ways that cannot be predicted.
357 
358  Parameters
359  ----------
360  other_config : `ConfigIR`
361  A `ConfigIR` instance to add or merge into the config attribute of
362  this task.
363  """
364  if not self.config:
365  self.config = [other_config]
366  return
367  self.config.extend(self.config.pop().maybe_merge(other_config))
368 

◆ to_primitives()

Dict[str, Union[str, List[dict]]] lsst.pipe.base.pipelineIR.TaskIR.to_primitives (   self)
Convert to a representation used in yaml serialization

Definition at line 342 of file pipelineIR.py.

342  def to_primitives(self) -> Dict[str, Union[str, List[dict]]]:
343  """Convert to a representation used in yaml serialization
344  """
345  accumulate: Dict[str, Union[str, List[dict]]] = {'class': self.klass}
346  if self.config:
347  accumulate['config'] = [c.to_primitives() for c in self.config]
348  return accumulate
349 

Member Data Documentation

◆ config

lsst.pipe.base.pipelineIR.TaskIR.config

Definition at line 365 of file pipelineIR.py.


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