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 | List of all members
lsst.pipe.base.pipelineIR.PipelineYamlLoader Class Reference
Inheritance diagram for lsst.pipe.base.pipelineIR.PipelineYamlLoader:

Public Member Functions

def construct_mapping (self, node, deep=False)
 

Detailed Description

This is a specialized version of yaml's SafeLoader. It checks and raises
an exception if it finds that there are multiple instances of the same key
found inside a pipeline file at a given scope.

Definition at line 44 of file pipelineIR.py.

Member Function Documentation

◆ construct_mapping()

def lsst.pipe.base.pipelineIR.PipelineYamlLoader.construct_mapping (   self,
  node,
  deep = False 
)

Definition at line 49 of file pipelineIR.py.

49  def construct_mapping(self, node, deep=False):
50  # do the call to super first so that it can do all the other forms of
51  # checking on this node. If you check the uniqueness of keys first
52  # it would save the work that super does in the case of a failure, but
53  # it might fail in the case that the node was the incorrect node due
54  # to a parsing error, and the resulting exception would be difficult to
55  # understand.
56  mapping = super().construct_mapping(node, deep)
57  # Check if there are any duplicate keys
58  all_keys = Counter(key_node.value for key_node, _ in node.value)
59  duplicates = {k for k, i in all_keys.items() if i != 1}
60  if duplicates:
61  raise KeyError("Pipeline files must not have duplicated keys, "
62  f"{duplicates} appeared multiple times")
63  return mapping
64 
65 

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