LSSTApplications  21.0.0+37efb4748c,21.0.0+d529cf1a41,21.0.0-1-g763706f+82d2095a8a,21.0.0-1-ga51b5d4+6432c6fd8d,21.0.0-10-g193f6d6+841aaaaed1,21.0.0-14-g3373693e+4fd0c50860,21.0.0-2-g103fe59+69943ec2fb,21.0.0-2-g1367e85+40e354ef4f,21.0.0-2-g2909d54+37efb4748c,21.0.0-2-g35ce6d5+82d2095a8a,21.0.0-2-g45278ab+d529cf1a41,21.0.0-2-g4bc9b9f+ce85f66004,21.0.0-2-g5242d73+40e354ef4f,21.0.0-2-g54e2caa+fba2a494aa,21.0.0-2-g5dd23de+0c9217bc05,21.0.0-2-g66bcc37+82d2095a8a,21.0.0-2-g7f82c8f+3b0f8a565c,21.0.0-2-g8dde007+ba9f988c25,21.0.0-2-g8f08a60+4fac22bdb7,21.0.0-2-g973f35b+2e2ad45137,21.0.0-2-ga326454+3b0f8a565c,21.0.0-2-ga63a54e+b444de7b2f,21.0.0-2-ga885a99+c1363b8d99,21.0.0-2-gc738bc1+7a8c394ce6,21.0.0-2-gde069b7+44dbdb3492,21.0.0-2-ge17e5af+40e354ef4f,21.0.0-2-ge712728+fd13bd6975,21.0.0-2-gecfae73+23f8c8aa96,21.0.0-2-gfc62afb+40e354ef4f,21.0.0-3-g4c5b185+7dba9ba07b,21.0.0-3-g5051ac2+d529cf1a41,21.0.0-3-gaa929c8+1e83416353,21.0.0-3-gd222c45+88b21af515,21.0.0-4-g051ac7e+1e83416353,21.0.0-4-g42917e2+018d660765,21.0.0-4-g642e80a+16737b7b95,21.0.0-6-g2b8c1f54+b37d742fec,21.0.0-7-g484459ba0+ce03d725a7,w.2020.50
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.base.pipelineIR.InheritIR Class Reference

Public Member Functions

"PipelineIR" toPipelineIR (self, instrument=None)
 
def __eq__ (self, "InheritIR" other)
 

Static Public Attributes

 bool
 

Detailed Description

An intermediate representation of inherited pipelines

Definition at line 373 of file pipelineIR.py.

Member Function Documentation

◆ __eq__()

def lsst.pipe.base.pipelineIR.InheritIR.__eq__ (   self,
"InheritIR"  other 
)

Definition at line 444 of file pipelineIR.py.

444  def __eq__(self, other: "InheritIR"):
445  if not isinstance(other, InheritIR):
446  return False
447  elif all(getattr(self, attr) == getattr(other, attr) for attr in
448  ("location", "include", "exclude", "importContracts")):
449  return True
450  else:
451  return False
452 
453 

◆ toPipelineIR()

"PipelineIR" lsst.pipe.base.pipelineIR.InheritIR.toPipelineIR (   self,
  instrument = None 
)
Load in the Pipeline specified by this object, and turn it into a
PipelineIR instance.

Parameters
----------
instrument : Optional `str`
    A string giving the fully qualified path to an instrument object.
    If a inherited pipeline defines the same instrument as defined in
    this variable, an import warning message is skipped.

Returns
-------
pipeline : `PipelineIR`
    A pipeline generated from the imported pipeline file

Definition at line 395 of file pipelineIR.py.

395  def toPipelineIR(self, instrument=None) -> "PipelineIR":
396  """Load in the Pipeline specified by this object, and turn it into a
397  PipelineIR instance.
398 
399  Parameters
400  ----------
401  instrument : Optional `str`
402  A string giving the fully qualified path to an instrument object.
403  If a inherited pipeline defines the same instrument as defined in
404  this variable, an import warning message is skipped.
405 
406  Returns
407  -------
408  pipeline : `PipelineIR`
409  A pipeline generated from the imported pipeline file
410  """
411  if self.include and self.exclude:
412  raise ValueError("Both an include and an exclude list cant be specified"
413  " when declaring a pipeline import")
414  tmp_pipeline = PipelineIR.from_file(os.path.expandvars(self.location))
415  if tmp_pipeline.instrument is not None and tmp_pipeline.instrument != instrument:
416  warnings.warn("Any instrument definitions in imported pipelines are ignored. "
417  "if an instrument is desired please define it in the top most pipeline")
418 
419  included_labels = set()
420  for label in tmp_pipeline.tasks:
421  if (self.include and label in self.include) or (self.exclude and label not in self.exclude)\
422  or (self.include is None and self.exclude is None):
423  included_labels.add(label)
424 
425  # Handle labeled subsets being specified in the include or exclude
426  # list, adding or removing labels.
427  if self.include is not None:
428  subsets_in_include = tmp_pipeline.labeled_subsets.keys() & self.include
429  for label in subsets_in_include:
430  included_labels.update(tmp_pipeline.labeled_subsets[label].subset)
431 
432  elif self.exclude is not None:
433  subsets_in_exclude = tmp_pipeline.labeled_subsets.keys() & self.exclude
434  for label in subsets_in_exclude:
435  included_labels.difference_update(tmp_pipeline.labeled_subsets[label].subset)
436 
437  tmp_pipeline = tmp_pipeline.subset_from_labels(included_labels)
438 
439  if not self.importContracts:
440  tmp_pipeline.contracts = []
441 
442  return tmp_pipeline
443 

Member Data Documentation

◆ bool

lsst.pipe.base.pipelineIR.InheritIR.bool
static

Definition at line 390 of file pipelineIR.py.


The documentation for this class was generated from the following file:
lsst::geom::all
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.
Definition: CoordinateExpr.h:81
set
daf::base::PropertySet * set
Definition: fits.cc:912