ATLAS Offline Software
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 2627 of file trfArgClasses.py.

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

◆ strToBool()

def python.trfArgClasses.strToBool (   string)

Small utility to convert a string value to a boolean.

Definition at line 2606 of file trfArgClasses.py.

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

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:224
python.trfArgClasses.dictSubstepMerge
def dictSubstepMerge(dict1, dict2)
special dictionary merger which is used for substep type arguments
Definition: trfArgClasses.py:2627
python.trfArgClasses.strToBool
def strToBool(string)
Small utility to convert a string value to a boolean.
Definition: trfArgClasses.py:2606