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 29 of file diffTreeTool.py.

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

References funct.abs().

◆ getDictFromObject()

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

Definition at line 18 of file diffTreeTool.py.

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

◆ getPieceFromObject()

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

Definition at line 13 of file diffTreeTool.py.

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

Variable Documentation

◆ action

diffTreeTool.action

Definition at line 67 of file diffTreeTool.py.

◆ args

diffTreeTool.args

Definition at line 72 of file diffTreeTool.py.

◆ cFile

diffTreeTool.cFile

Definition at line 83 of file diffTreeTool.py.

◆ default

diffTreeTool.default

Definition at line 67 of file diffTreeTool.py.

◆ dest

diffTreeTool.dest

Definition at line 66 of file diffTreeTool.py.

◆ diff

diffTreeTool.diff

Definition at line 197 of file diffTreeTool.py.

◆ diffColl

diffTreeTool.diffColl

Definition at line 188 of file diffTreeTool.py.

◆ diffContRE

diffTreeTool.diffContRE

Definition at line 89 of file diffTreeTool.py.

◆ end

diffTreeTool.end

Definition at line 155 of file diffTreeTool.py.

◆ epsilon

diffTreeTool.epsilon

Definition at line 11 of file diffTreeTool.py.

◆ firstOnly

diffTreeTool.firstOnly

Definition at line 161 of file diffTreeTool.py.

◆ firstOnlyColl

diffTreeTool.firstOnlyColl

Definition at line 152 of file diffTreeTool.py.

◆ help

diffTreeTool.help

Definition at line 68 of file diffTreeTool.py.

◆ index

diffTreeTool.index

Definition at line 162 of file diffTreeTool.py.

◆ indexDoubleDict

diffTreeTool.indexDoubleDict

Definition at line 138 of file diffTreeTool.py.

◆ indexSingleDict

diffTreeTool.indexSingleDict

Definition at line 137 of file diffTreeTool.py.

◆ info

diffTreeTool.info

Definition at line 164 of file diffTreeTool.py.

◆ infoDoubleDict

diffTreeTool.infoDoubleDict

Definition at line 140 of file diffTreeTool.py.

◆ infoSingleDict

diffTreeTool.infoSingleDict

Definition at line 139 of file diffTreeTool.py.

◆ match

diffTreeTool.match

Definition at line 102 of file diffTreeTool.py.

◆ name

diffTreeTool.name

Definition at line 98 of file diffTreeTool.py.

◆ options

diffTreeTool.options

Definition at line 72 of file diffTreeTool.py.

◆ parser

diffTreeTool.parser

Definition at line 65 of file diffTreeTool.py.

◆ rootfile

diffTreeTool.rootfile

Definition at line 129 of file diffTreeTool.py.

◆ rootFilename

diffTreeTool.rootFilename

Definition at line 77 of file diffTreeTool.py.

◆ runevent

diffTreeTool.runevent

Definition at line 149 of file diffTreeTool.py.

◆ runeventDict

diffTreeTool.runeventDict

Definition at line 136 of file diffTreeTool.py.

◆ secondOnly

diffTreeTool.secondOnly

Definition at line 179 of file diffTreeTool.py.

◆ secondOnlyColl

diffTreeTool.secondOnlyColl

Definition at line 170 of file diffTreeTool.py.

◆ shlib

diffTreeTool.shlib

Definition at line 78 of file diffTreeTool.py.

◆ size

diffTreeTool.size

Definition at line 135 of file diffTreeTool.py.

◆ source

diffTreeTool.source

Definition at line 95 of file diffTreeTool.py.

◆ stringSet

diffTreeTool.stringSet

Definition at line 96 of file diffTreeTool.py.

◆ tree

diffTreeTool.tree

Definition at line 132 of file diffTreeTool.py.

◆ typeFoundSet

diffTreeTool.typeFoundSet

Definition at line 97 of file diffTreeTool.py.

◆ var

diffTreeTool.var

Definition at line 166 of file diffTreeTool.py.

◆ variableREDict

diffTreeTool.variableREDict

Definition at line 91 of file diffTreeTool.py.

◆ variables

diffTreeTool.variables

Definition at line 79 of file diffTreeTool.py.

◆ working

diffTreeTool.working

Definition at line 118 of file diffTreeTool.py.

diffTreeTool.getPieceFromObject
def getPieceFromObject(obj, description)
Definition: diffTreeTool.py:13
diffTreeTool.format
def format(objDict, label, spacing=9, firstOnly=False)
Definition: diffTreeTool.py:29
diffTreeTool.getDictFromObject
def getDictFromObject(obj, varDict, prefix='')
Definition: diffTreeTool.py:18
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22