CMS 3D CMS Logo

Functions | Variables
diffTreeTool Namespace Reference

Functions

def format (objDict, label, spacing=9, firstOnly=False)
 
def getDictFromObject (obj, varDict, prefix='')
 
def getPieceFromObject (obj, description)
 

Variables

 action
 
 args
 
 cFile
 
 default
 
 dest
 
 diff
 
 diffColl
 
 diffContRE
 
 end
 
 epsilon
 
 firstOnly
 
 firstOnlyColl
 
 help
 
 index
 
 indexDoubleDict
 
 indexSingleDict
 
 info
 
 infoDoubleDict
 
 infoSingleDict
 
 match
 
 name
 
 options
 
 parser
 
 rootfile
 
 rootFilename
 
 runevent
 
 runeventDict
 
 secondOnly
 
 secondOnlyColl
 
 shlib
 
 size
 
 source
 
 stringSet
 
 tree
 
 typeFoundSet
 
 var
 
 variableREDict
 
 variables
 
 working
 

Function Documentation

◆ format()

def diffTreeTool.format (   objDict,
  label,
  spacing = 9,
  firstOnly = False 
)
return a formatted string for given object

Definition at line 28 of file diffTreeTool.py.

References funct.abs().

28 def format (objDict, label, spacing=9, firstOnly = False):
29  '''return a formatted string for given object'''
30  value = objDict[label]
31  if firstOnly:
32  diff = 0.
33  else:
34  diff = objDict['delta_' + label]
35 
36  problem = False
37  if isinstance (value, float):
38  formatString = '%%%d.%df' % (spacing, spacing - 5)
39  retval = formatString % value
40  if abs(diff) > epsilon:
41  if options.delta:
42  retval += ' [' + formatString % (diff) + ']'
43  else:
44  retval += ' (' + formatString % (value + diff) + ')'
45  elif not firstOnly:
46  retval += ' ' * (spacing + 3)
47  return retval
48  else:
49  formatString = '%%%ds' % spacing
50  retval = formatString % value
51  if diff:
52  if isinstance (value, str):
53  retval += ' (' + formatString % diff + ')'
54  elif options.delta:
55  retval += ' [' + formatString % diff + ']'
56  else:
57  retval += ' (' + formatString % (value + diff) + ')'
58  elif not firstOnly:
59  retval += ' ' * (spacing + 3)
60  return retval
61 
62 
def format(objDict, label, spacing=9, firstOnly=False)
Definition: diffTreeTool.py:28
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ getDictFromObject()

def diffTreeTool.getDictFromObject (   obj,
  varDict,
  prefix = '' 
)
Given a object and a prefix, fills an return dictionary with the
proper values

Definition at line 17 of file diffTreeTool.py.

17 def getDictFromObject (obj, varDict, prefix = ''):
18  """Given a object and a prefix, fills an return dictionary with the
19  proper values"""
20  if prefix:
21  obj = getPieceFromObject (obj, prefix)
22  retval = {}
23  for key, description in varDict.items():
24  retval[key] = getPieceFromObject (obj, description)
25  return retval
26 
27 
def getDictFromObject(obj, varDict, prefix='')
Definition: diffTreeTool.py:17

◆ getPieceFromObject()

def diffTreeTool.getPieceFromObject (   obj,
  description 
)
Returns piece from object 

Definition at line 12 of file diffTreeTool.py.

12 def getPieceFromObject (obj, description):
13  """Returns piece from object """
14  parsed = GenObject.parseVariableTofill (description)
15  return GenObject.evaluateFunction (obj, parsed)
16 
def getPieceFromObject(obj, description)
Definition: diffTreeTool.py:12

Variable Documentation

◆ action

diffTreeTool.action

Definition at line 66 of file diffTreeTool.py.

◆ args

diffTreeTool.args

Definition at line 71 of file diffTreeTool.py.

◆ cFile

diffTreeTool.cFile

Definition at line 82 of file diffTreeTool.py.

◆ default

diffTreeTool.default

Definition at line 66 of file diffTreeTool.py.

◆ dest

diffTreeTool.dest

Definition at line 65 of file diffTreeTool.py.

◆ diff

diffTreeTool.diff

Definition at line 196 of file diffTreeTool.py.

◆ diffColl

diffTreeTool.diffColl

Definition at line 187 of file diffTreeTool.py.

◆ diffContRE

diffTreeTool.diffContRE

Definition at line 88 of file diffTreeTool.py.

◆ end

diffTreeTool.end

Definition at line 154 of file diffTreeTool.py.

◆ epsilon

diffTreeTool.epsilon

Definition at line 10 of file diffTreeTool.py.

◆ firstOnly

diffTreeTool.firstOnly

Definition at line 160 of file diffTreeTool.py.

◆ firstOnlyColl

diffTreeTool.firstOnlyColl

Definition at line 151 of file diffTreeTool.py.

◆ help

diffTreeTool.help

Definition at line 67 of file diffTreeTool.py.

◆ index

diffTreeTool.index

Definition at line 161 of file diffTreeTool.py.

◆ indexDoubleDict

diffTreeTool.indexDoubleDict

Definition at line 137 of file diffTreeTool.py.

◆ indexSingleDict

diffTreeTool.indexSingleDict

Definition at line 136 of file diffTreeTool.py.

◆ info

diffTreeTool.info

Definition at line 163 of file diffTreeTool.py.

◆ infoDoubleDict

diffTreeTool.infoDoubleDict

Definition at line 139 of file diffTreeTool.py.

◆ infoSingleDict

diffTreeTool.infoSingleDict

Definition at line 138 of file diffTreeTool.py.

◆ match

diffTreeTool.match

Definition at line 101 of file diffTreeTool.py.

◆ name

diffTreeTool.name

Definition at line 97 of file diffTreeTool.py.

◆ options

diffTreeTool.options

Definition at line 71 of file diffTreeTool.py.

◆ parser

diffTreeTool.parser

Definition at line 64 of file diffTreeTool.py.

◆ rootfile

diffTreeTool.rootfile

Definition at line 128 of file diffTreeTool.py.

◆ rootFilename

diffTreeTool.rootFilename

Definition at line 76 of file diffTreeTool.py.

◆ runevent

diffTreeTool.runevent

Definition at line 148 of file diffTreeTool.py.

◆ runeventDict

diffTreeTool.runeventDict

Definition at line 135 of file diffTreeTool.py.

◆ secondOnly

diffTreeTool.secondOnly

Definition at line 178 of file diffTreeTool.py.

◆ secondOnlyColl

diffTreeTool.secondOnlyColl

Definition at line 169 of file diffTreeTool.py.

◆ shlib

diffTreeTool.shlib

Definition at line 77 of file diffTreeTool.py.

◆ size

diffTreeTool.size

Definition at line 134 of file diffTreeTool.py.

◆ source

diffTreeTool.source

Definition at line 94 of file diffTreeTool.py.

◆ stringSet

diffTreeTool.stringSet

Definition at line 95 of file diffTreeTool.py.

◆ tree

diffTreeTool.tree

Definition at line 131 of file diffTreeTool.py.

◆ typeFoundSet

diffTreeTool.typeFoundSet

Definition at line 96 of file diffTreeTool.py.

◆ var

diffTreeTool.var

Definition at line 165 of file diffTreeTool.py.

◆ variableREDict

diffTreeTool.variableREDict

Definition at line 90 of file diffTreeTool.py.

◆ variables

diffTreeTool.variables

Definition at line 78 of file diffTreeTool.py.

◆ working

diffTreeTool.working

Definition at line 117 of file diffTreeTool.py.