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 2646 of file trfArgClasses.py.

2646 def dictSubstepMerge(dict1, dict2):
2647  mergeDict = {}
2648  allKeys = set(dict1) | set(dict2)
2649  # Find the value type - lists are special...
2650  listType = False
2651  if len(dict1) > 0:
2652  if isinstance(list(dict1.values())[0], list):
2653  listType = True
2654  elif len(dict2) > 0:
2655  if isinstance(list(dict2.values())[0], list):
2656  listType = True
2657  if listType:
2658  for key in allKeys:
2659  mergeDict[key] = dict1.get(key, []) + dict2.get(key, [])
2660  else:
2661  for key in allKeys:
2662  if key in dict1 and key in dict2:
2663  # Don't really know what to do if these clash...
2664  if dict1[key] != dict2[key]:
2665  raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'),
2666  'Merging substep arguments found clashing values for substep {0}: {1}!={2}'.format(key, dict1[key], dict2[key]))
2667  mergeDict[key] = dict1[key]
2668  elif key in dict1:
2669  mergeDict[key] = dict1[key]
2670  else:
2671  mergeDict[key] = dict2[key]
2672 
2673  return mergeDict
2674 
2675 

◆ strToBool()

def python.trfArgClasses.strToBool (   string)

Small utility to convert a string value to a boolean.

Definition at line 2625 of file trfArgClasses.py.

2625 def strToBool(string):
2626  try:
2627  msg.debug("converting string {string} to boolean".format(string = string))
2628  if string.lower() == 'false':
2629  return False
2630  elif string.lower() == 'true':
2631  return True
2632  else:
2633  raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'), 'Failed to convert value {0} to bool'.format(string))
2634  except AttributeError:
2635  raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'), 'Failed to convert value {0} to bool'.format(string))
2636 

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:2646
python.trfArgClasses.strToBool
def strToBool(string)
Small utility to convert a string value to a boolean.
Definition: trfArgClasses.py:2625