Loading [MathJax]/jax/input/TeX/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Functions | Variables
python.trfArgClasses Namespace Reference

Classes

class  argAction
 
class  argActionFactory
 Factory class used to generate argparse actions, actions should be used when arguments are used without value, like boolean flags. More...
 
class  argAthenaFile
 Athena file class. More...
 
class  argBool
 Boolean type argument. More...
 
class  argBSFile
 ByteStream file class. More...
 
class  argBZ2File
 TarBZ filetype. More...
 
class  argEVNT_TRFile
 
class  argEVNTFile
 
class  argFactory
 Factory class used to generate argument class instances for argparse. More...
 
class  argFile
 File argument class. More...
 
class  argFloat
 Float type argument. More...
 
class  argFTKIPFile
 Class which defines a special input file format used in FTK simulation
More...
 
class  argHepEvtAsciiFile
 HEP ASCII file. More...
 
class  argHISTFile
 Data quality histogram file class. More...
 
class  argHITSFile
 
class  argInt
 Int type argument. More...
 
class  argIntList
 List of int arguments. More...
 
class  argKeyFloatValueList
 
class  argLHEFile
 LHE ASCII file. More...
 
class  argList
 List of string arguments. More...
 
class  argNTUPFile
 NTUP (plain ROOT) file class. More...
 
class  argPOOLFile
 POOL file class. More...
 
class  argRDOFile
 
class  argString
 String type argument. More...
 
class  argSubstep
 Base class for substep arguments. More...
 
class  argSubstepBool
 Boolean substep argument. More...
 
class  argSubstepConditions
 Substep class for conditionsTag. More...
 
class  argSubstepFloat
 Float substep argument. More...
 
class  argSubstepInt
 Int substep argument. More...
 
class  argSubstepList
 Argument class for substep lists, suitable for preExec/postExec. More...
 
class  argSubstepSteering
 Special argument class to hold steering information. More...
 
class  argSubstepString
 String substep argument. More...
 
class  argument
 Basic argument class holding a value which can be get and set. More...
 
class  argYODAFile
 
class  trfArgParser
 

Functions

def strToBool (string)
 Small utility to convert a string value to a boolean. More...
 
def dictSubstepMerge (dict1, dict2)
 special dictionary merger which is used for substep type arguments More...
 

Variables

 msg
 

Function Documentation

◆ dictSubstepMerge()

def python.trfArgClasses.dictSubstepMerge (   dict1,
  dict2 
)

special dictionary merger which is used for substep type arguments

Uses set class to get the unique list of keys. Any key present in only one dictionary is unaltered. If the values are lists they are catenated, otherwise the values are picked from the dictionary in which it is set.

Parameters

Definition at line 2630 of file trfArgClasses.py.

2630 def dictSubstepMerge(dict1, dict2):
2631  mergeDict = {}
2632  allKeys = set(dict1) | set(dict2)
2633  # Find the value type - lists are special...
2634  listType = False
2635  if len(dict1) > 0:
2636  if isinstance(list(dict1.values())[0], list):
2637  listType = True
2638  elif len(dict2) > 0:
2639  if isinstance(list(dict2.values())[0], list):
2640  listType = True
2641  if listType:
2642  for key in allKeys:
2643  mergeDict[key] = dict1.get(key, []) + dict2.get(key, [])
2644  else:
2645  for key in allKeys:
2646  if key in dict1 and key in dict2:
2647  # Don't really know what to do if these clash...
2648  if dict1[key] != dict2[key]:
2649  raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'),
2650  'Merging substep arguments found clashing values for substep {0}: {1}!={2}'.format(key, dict1[key], dict2[key]))
2651  mergeDict[key] = dict1[key]
2652  elif key in dict1:
2653  mergeDict[key] = dict1[key]
2654  else:
2655  mergeDict[key] = dict2[key]
2656 
2657  return mergeDict
2658 
2659 

◆ strToBool()

def python.trfArgClasses.strToBool (   string)

Small utility to convert a string value to a boolean.

Definition at line 2609 of file trfArgClasses.py.

2609 def strToBool(string):
2610  try:
2611  msg.debug("converting string {string} to boolean".format(string = string))
2612  if string.lower() == 'false':
2613  return False
2614  elif string.lower() == 'true':
2615  return True
2616  else:
2617  raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'), 'Failed to convert value {0} to bool'.format(string))
2618  except AttributeError:
2619  raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'), 'Failed to convert value {0} to bool'.format(string))
2620 

Variable Documentation

◆ msg

python.trfArgClasses.msg

Definition at line 17 of file trfArgClasses.py.

vtune_athena.format
format
Definition: vtune_athena.py:14
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.trfArgClasses.dictSubstepMerge
def dictSubstepMerge(dict1, dict2)
special dictionary merger which is used for substep type arguments
Definition: trfArgClasses.py:2630
python.trfArgClasses.strToBool
def strToBool(string)
Small utility to convert a string value to a boolean.
Definition: trfArgClasses.py:2609