iterator over a list of dicts (the 'task'). Each dict must contain 'evts', optionally 'force_new'.
Definition at line 104 of file RunDependentMCTaskIterator.py.
◆ __init__()
def python.RunDependentMCTaskIterator.taskIterator.__init__ |
( |
|
self, |
|
|
|
task, |
|
|
|
step |
|
) |
| |
create the iterator from task (a list of dicts) and step (the max number of evts. per job)
the iterator
Definition at line 107 of file RunDependentMCTaskIterator.py.
108 """create the iterator from task (a list of dicts) and step (the max number of evts. per job)
111 self.taskit = itertools.cycle(task)
116 if min(e[
'evts']
for e
in task) < 0:
117 raise ValueError(
"Cannot use empty task lists or negative N(events).")
119 raise ValueError(
"Cannot use tasks that don't always define 'evts':", task)
120 if (step < 1):
raise ValueError(
"Cannot use step size smaller than 1 in a taskIterator.")
◆ __eq__()
def python.RunDependentMCTaskIterator.taskIterator.__eq__ |
( |
|
self, |
|
|
|
another |
|
) |
| |
Definition at line 123 of file RunDependentMCTaskIterator.py.
123 def __eq__(self, another):
124 return (self.current == another.current)
and (self.step == another.step)
◆ __iter__()
def python.RunDependentMCTaskIterator.taskIterator.__iter__ |
( |
|
self | ) |
|
◆ __next__()
def python.RunDependentMCTaskIterator.taskIterator.__next__ |
( |
|
self | ) |
|
Definition at line 132 of file RunDependentMCTaskIterator.py.
134 if (self.current
is None): self.current =
next(self.taskit)
137 if (to_do == 0) :
return self.offset, self.current
138 can_do = self.current[
'evts'] - self.offset
139 if ( can_do > to_do ) :
141 self.donejob[-1].
update({
'evts':to_do})
143 return self.offset, self.current
149 self.donejob[-1].
update({
'evts':can_do})
150 self.current =
next(self.taskit)
151 if self.current.
get(
'force_new',
False): to_do = 0
◆ __repr__()
def python.RunDependentMCTaskIterator.taskIterator.__repr__ |
( |
|
self | ) |
|
◆ current
python.RunDependentMCTaskIterator.taskIterator.current |
◆ donejob
python.RunDependentMCTaskIterator.taskIterator.donejob |
◆ offset
python.RunDependentMCTaskIterator.taskIterator.offset |
◆ step
python.RunDependentMCTaskIterator.taskIterator.step |
◆ taskit
python.RunDependentMCTaskIterator.taskIterator.taskit |
The documentation for this class was generated from the following file: