LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
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: