ATLAS Offline Software
Classes | Functions
python.MpUtils Namespace Reference

Classes

class  SubProcessIterator
 

Functions

def chunkify (s, chunksize)
 
def piter (iterable, eoi=None)
 

Function Documentation

◆ chunkify()

def python.MpUtils.chunkify (   s,
  chunksize 
)
Yield sequence s in chunks of size chunksize.

>>> list(chunkify('abcdefg', 2))
['ab', 'cd', 'ef', 'g']

>>> list(chunkify('abcdefg', 99))
['abcdefg']

Definition at line 9 of file MpUtils.py.

9 def chunkify(s, chunksize):
10 
11  """
12  Yield sequence s in chunks of size chunksize.
13 
14  >>> list(chunkify('abcdefg', 2))
15  ['ab', 'cd', 'ef', 'g']
16 
17  >>> list(chunkify('abcdefg', 99))
18  ['abcdefg']
19 
20  """
21 
22  for i in range(0, len(s), chunksize):
23  yield s[i:i+chunksize]
24 

◆ piter()

def python.MpUtils.piter (   iterable,
  eoi = None 
)
Create a new subprocess iterator.

iterable : some iterable task to execute in a subprocess
eoi : an end-of-iteration marker - returned from the subprocess
      to signal that iteration is complete.

Definition at line 69 of file MpUtils.py.

69 def piter(iterable, eoi=None):
70  """Create a new subprocess iterator.
71 
72  iterable : some iterable task to execute in a subprocess
73  eoi : an end-of-iteration marker - returned from the subprocess
74  to signal that iteration is complete.
75  """
76  return SubProcessIterator(iterable, eoi=eoi)
77 
python.MpUtils.chunkify
def chunkify(s, chunksize)
Definition: MpUtils.py:9
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.MpUtils.piter
def piter(iterable, eoi=None)
Definition: MpUtils.py:69