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

Public Member Functions

"PipelineIR" toPipelineIR (self)
 
def __eq__ (self, object other)
 

Static Public Attributes

 bool
 

Detailed Description

An intermediate representation of imported pipelines

Definition at line 380 of file pipelineIR.py.

Member Function Documentation

◆ __eq__()

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

Definition at line 449 of file pipelineIR.py.

449  def __eq__(self, other: object):
450  if not isinstance(other, ImportIR):
451  return False
452  elif all(getattr(self, attr) == getattr(other, attr) for attr in
453  ("location", "include", "exclude", "importContracts")):
454  return True
455  else:
456  return False
457 
458 
bool all(CoordinateExpr< N > const &expr) noexcept
Return true if all elements are true.

◆ toPipelineIR()

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

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

Definition at line 408 of file pipelineIR.py.

408  def toPipelineIR(self) -> "PipelineIR":
409  """Load in the Pipeline specified by this object, and turn it into a
410  PipelineIR instance.
411 
412  Returns
413  -------
414  pipeline : `PipelineIR`
415  A pipeline generated from the imported pipeline file
416  """
417  if self.include and self.exclude:
418  raise ValueError("Both an include and an exclude list cant be specified"
419  " when declaring a pipeline import")
420  tmp_pipeline = PipelineIR.from_uri(os.path.expandvars(self.location))
421  if self.instrument is not KeepInstrument:
422  tmp_pipeline.instrument = self.instrument
423 
424  included_labels = set()
425  for label in tmp_pipeline.tasks:
426  if (self.include and label in self.include) or (self.exclude and label not in self.exclude)\
427  or (self.include is None and self.exclude is None):
428  included_labels.add(label)
429 
430  # Handle labeled subsets being specified in the include or exclude
431  # list, adding or removing labels.
432  if self.include is not None:
433  subsets_in_include = tmp_pipeline.labeled_subsets.keys() & self.include
434  for label in subsets_in_include:
435  included_labels.update(tmp_pipeline.labeled_subsets[label].subset)
436 
437  elif self.exclude is not None:
438  subsets_in_exclude = tmp_pipeline.labeled_subsets.keys() & self.exclude
439  for label in subsets_in_exclude:
440  included_labels.difference_update(tmp_pipeline.labeled_subsets[label].subset)
441 
442  tmp_pipeline = tmp_pipeline.subset_from_labels(included_labels)
443 
444  if not self.importContracts:
445  tmp_pipeline.contracts = []
446 
447  return tmp_pipeline
448 
daf::base::PropertySet * set
Definition: fits.cc:912

Member Data Documentation

◆ bool

lsst.pipe.base.pipelineIR.ImportIR.bool
static

Definition at line 397 of file pipelineIR.py.


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