ATLAS Offline Software
Loading...
Searching...
No Matches
python.ConfigBlock Namespace Reference

Classes

class  BlockNameProcessorMeta
class  ConfigBlock
class  ConfigBlockDependency
class  ConfigBlockOption

Functions

 filter_dsids (filterList, config)
 alphanumeric_block_name (func)

Variables

 logCPAlgCfgBlock = logging.getLogger('CPAlgCfgBlock')

Function Documentation

◆ alphanumeric_block_name()

python.ConfigBlock.alphanumeric_block_name ( func)
this wrapper ensures that the 'instanceName' of the various 
config blocks is cleaned up of any non-alphanumeric characters 
that may arise from using 'selectionName' in the naming.

Definition at line 31 of file ConfigBlock.py.

31def alphanumeric_block_name(func):
32 """this wrapper ensures that the 'instanceName' of the various """
33 """config blocks is cleaned up of any non-alphanumeric characters """
34 """that may arise from using 'selectionName' in the naming."""
35 @wraps(func)
36 def wrapper(*args, **kwargs):
37 # Get the string returned by the 'instanceName()' method of a config block
38 orig_name = func(*args, **kwargs)
39
40 if orig_name is None:
41 return ""
42
43 # Allowed replacements - anything else is likely a mistake on the user-side
44 result = orig_name.replace("||", "OR").replace("&&", "AND").replace("(","LB").replace(")","RB").replace(" ","")
45
46 return result
47 return wrapper
48
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:310

◆ filter_dsids()

python.ConfigBlock.filter_dsids ( filterList,
config )
check whether the sample being run passes a
possible DSID filter on the block

Definition at line 14 of file ConfigBlock.py.

14def filter_dsids (filterList, config) :
15 """check whether the sample being run passes a"""
16 """possible DSID filter on the block"""
17 if len(filterList) == 0:
18 return True
19 for dsid_filter in filterList:
20 # Check if the pattern is enclosed in regex delimiters (e.g., starts with '^' or contains regex metacharacters)
21 if any(char in str(dsid_filter) for char in "^$*+?.()|[]{}\\"):
22 pattern = re.compile(dsid_filter)
23 if pattern.match(str(config.dsid())):
24 return True
25 else:
26 # Otherwise it's an exact DSID (but could be int or string)
27 if str(dsid_filter) == str(config.dsid()):
28 return True
29 return False
30

Variable Documentation

◆ logCPAlgCfgBlock

python.ConfigBlock.logCPAlgCfgBlock = logging.getLogger('CPAlgCfgBlock')

Definition at line 9 of file ConfigBlock.py.