 |
ATLAS Offline Software
|
|
def | parAND (name, subs=[], invert=False) |
|
def | parOR (name, subs=[], invert=False) |
|
def | seqAND (name, subs=[], invert=False) |
|
def | seqOR (name, subs=[], invert=False) |
|
def | getSequenceChildren (comp) |
|
def | checkSequenceConsistency (seq) |
|
def | isSequence (obj) |
|
def | findSubSequence (start, nameToLookFor) |
|
def | findOwningSequence (start, nameToLookFor) |
|
def | findAlgorithmByPredicate (startSequence, predicate, depth=1000000) |
|
def | findAlgorithm (startSequence, nameToLookFor, depth=1000000) |
|
def | findAllAlgorithms (sequence, nameToLookFor=None) |
|
def | findAllAlgorithmsByName (sequence, namesToLookFor=None) |
|
def | flatAlgorithmSequences (start) |
|
def | iterSequences (start) |
|
◆ checkSequenceConsistency()
def python.CFElements.checkSequenceConsistency |
( |
|
seq | ) |
|
Enforce rules for sequence graph - identical items can not be added to itself (even indirectly)
Definition at line 56 of file CFElements.py.
57 """ Enforce rules for sequence graph - identical items can not be added to itself (even indirectly) """
59 def __noSubSequenceOfName( s, n, seen = set() ):
64 raise RuntimeError(f
"Sequence {c.getName()} contains itself")
67 raise RuntimeError(f
"Sequence {n} contains sub-sequence of the same name")
68 __noSubSequenceOfName( c, c.getName(), seen )
69 __noSubSequenceOfName( c, n, seen )
71 __noSubSequenceOfName( seq, seq.getName() )
◆ findAlgorithm()
def python.CFElements.findAlgorithm |
( |
|
startSequence, |
|
|
|
nameToLookFor, |
|
|
|
depth = 1000000 |
|
) |
| |
Traverse sequences tree to find the algorithm of given name. The first encountered is returned.
The name() method is used to obtain the algorithm name, that one has to match to the request.
Definition at line 123 of file CFElements.py.
123 def findAlgorithm( startSequence, nameToLookFor, depth = 1000000 ):
124 """ Traverse sequences tree to find the algorithm of given name. The first encountered is returned.
126 The name() method is used to obtain the algorithm name, that one has to match to the request.
◆ findAlgorithmByPredicate()
def python.CFElements.findAlgorithmByPredicate |
( |
|
startSequence, |
|
|
|
predicate, |
|
|
|
depth = 1000000 |
|
) |
| |
Traverse sequences tree to find the first algorithm satisfying given predicate. The first encountered is returned.
Depth of the search can be controlled by the depth parameter.
Typical use is to limit search to the startSequence with depth parameter set to 1
Definition at line 104 of file CFElements.py.
105 """ Traverse sequences tree to find the first algorithm satisfying given predicate. The first encountered is returned.
107 Depth of the search can be controlled by the depth parameter.
108 Typical use is to limit search to the startSequence with depth parameter set to 1
◆ findAllAlgorithms()
def python.CFElements.findAllAlgorithms |
( |
|
sequence, |
|
|
|
nameToLookFor = None |
|
) |
| |
Returns flat listof of all algorithm instances in this, and in sub-sequences
Definition at line 131 of file CFElements.py.
133 Returns flat listof of all algorithm instances in this, and in sub-sequences
140 if nameToLookFor
is None or child.getName() == nameToLookFor:
141 algorithms.append(child)
◆ findAllAlgorithmsByName()
def python.CFElements.findAllAlgorithmsByName |
( |
|
sequence, |
|
|
|
namesToLookFor = None |
|
) |
| |
Finds all algorithms in sequence and groups them by name
Resulting dict has a following structure
{"Alg1Name":[(Alg1Instance, parentSequenceA, indexInSequenceA),(Alg1Instance, parentSequenceB, indexInSequenceB)],
"Alg2Name":(Alg2Instance, parentSequence, indexInThisSequence),
....}
Definition at line 145 of file CFElements.py.
147 Finds all algorithms in sequence and groups them by name
149 Resulting dict has a following structure
150 {"Alg1Name":[(Alg1Instance, parentSequenceA, indexInSequenceA),(Alg1Instance, parentSequenceB, indexInSequenceB)],
151 "Alg2Name":(Alg2Instance, parentSequence, indexInThisSequence),
154 algorithms = collections.defaultdict(list)
156 if child.getName() == sequence.getName():
157 raise RuntimeError(f
"Recursively-nested sequence: {child.getName()} contains itself")
160 for algName
in childAlgs:
161 algorithms[algName] += childAlgs[algName]
163 if namesToLookFor
is None or child.getName()
in namesToLookFor:
164 algorithms[child.getName()].
append( (child, sequence, idx) )
◆ findOwningSequence()
def python.CFElements.findOwningSequence |
( |
|
start, |
|
|
|
nameToLookFor |
|
) |
| |
find sequence that owns the sequence nameTooLookFor
Definition at line 92 of file CFElements.py.
93 """ find sequence that owns the sequence nameTooLookFor"""
95 if c.getName() == nameToLookFor:
◆ findSubSequence()
def python.CFElements.findSubSequence |
( |
|
start, |
|
|
|
nameToLookFor |
|
) |
| |
Traverse sequences tree to find a sequence of a given name. The first one is returned.
Definition at line 78 of file CFElements.py.
79 """ Traverse sequences tree to find a sequence of a given name. The first one is returned. """
80 if start.getName() == nameToLookFor:
84 if c.getName() == nameToLookFor:
◆ flatAlgorithmSequences()
def python.CFElements.flatAlgorithmSequences |
( |
|
start | ) |
|
Converts tree like structure of sequences into dictionary
keyed by top/start sequence name containing lists of of algorithms & sequences.
Definition at line 168 of file CFElements.py.
169 """ Converts tree like structure of sequences into dictionary
170 keyed by top/start sequence name containing lists of of algorithms & sequences."""
172 def __inner( seq, collector ):
174 collector[seq.getName()].
append( c )
176 __inner( c, collector )
178 from collections
import defaultdict,OrderedDict
179 c = defaultdict(list)
181 return OrderedDict(c)
◆ getSequenceChildren()
def python.CFElements.getSequenceChildren |
( |
|
comp | ) |
|
Return sequence children (empty if comp is not a sequence)
Definition at line 48 of file CFElements.py.
49 """Return sequence children (empty if comp is not a sequence)"""
52 except AttributeError:
◆ isSequence()
def python.CFElements.isSequence |
( |
|
obj | ) |
|
Definition at line 74 of file CFElements.py.
75 return isinstance(obj, AthSequencer)
◆ iterSequences()
def python.CFElements.iterSequences |
( |
|
start | ) |
|
Iterator of sequences and their algorithms from (and including) the `start`
sequence object. Do start from a sequence name use findSubSequence.
Definition at line 184 of file CFElements.py.
185 """Iterator of sequences and their algorithms from (and including) the `start`
186 sequence object. Do start from a sequence name use findSubSequence."""
191 yield from __inner(c)
193 yield from __inner(start)
◆ parAND()
def python.CFElements.parAND |
( |
|
name, |
|
|
|
subs = [] , |
|
|
|
invert = False |
|
) |
| |
parallel AND sequencer
Definition at line 7 of file CFElements.py.
7 def parAND(name, subs=[], invert=False):
8 """parallel AND sequencer"""
14 Members = subs.copy() )
◆ parOR()
def python.CFElements.parOR |
( |
|
name, |
|
|
|
subs = [] , |
|
|
|
invert = False |
|
) |
| |
parallel OR sequencer
This is the default sequencer and lets the DataFlow govern the execution entirely.
Definition at line 16 of file CFElements.py.
16 def parOR(name, subs=[], invert=False):
17 """parallel OR sequencer
18 This is the default sequencer and lets the DataFlow govern the execution entirely.
25 Members = subs.copy() )
◆ seqAND()
def python.CFElements.seqAND |
( |
|
name, |
|
|
|
subs = [] , |
|
|
|
invert = False |
|
) |
| |
sequential AND sequencer
Definition at line 27 of file CFElements.py.
27 def seqAND(name, subs=[], invert=False):
28 """sequential AND sequencer"""
34 Members = subs.copy() )
◆ seqOR()
def python.CFElements.seqOR |
( |
|
name, |
|
|
|
subs = [] , |
|
|
|
invert = False |
|
) |
| |
sequential OR sequencer
Used when a barrier needs to be set by all subs reached irrespective of the decision
Definition at line 36 of file CFElements.py.
36 def seqOR(name, subs=[], invert=False):
37 """sequential OR sequencer
38 Used when a barrier needs to be set by all subs reached irrespective of the decision
45 Members = subs.copy() )
◆ AthSequencer
python.CFElements.AthSequencer = CompFactory.AthSequencer |
def flatAlgorithmSequences(start)
def findAllAlgorithms(sequence, nameToLookFor=None)
def findOwningSequence(start, nameToLookFor)
def findAlgorithmByPredicate(startSequence, predicate, depth=1000000)
def findAllAlgorithmsByName(sequence, namesToLookFor=None)
def parOR(name, subs=[], invert=False)
def parAND(name, subs=[], invert=False)
def checkSequenceConsistency(seq)
def seqAND(name, subs=[], invert=False)
def findSubSequence(start, nameToLookFor)
def findAlgorithm(startSequence, nameToLookFor, depth=1000000)
def getSequenceChildren(comp)
def seqOR(name, subs=[], invert=False)