ATLAS Offline Software
Loading...
Searching...
No Matches
python.TrigValSteering.Common Namespace Reference

Functions

 get_logger ()
 art_result (result, name)
 clear_art_summary ()
 find_file (pattern)
 find_file_in_path (filename, path_env_var)
 running_in_CI ()

Variables

 trigvalsteering_logging_level = logging.INFO
dict package_prefix_dict
str art_result_summary = 'art-result-summary.log'
str art_input_eos = '/eos/atlas/atlascerngroupdisk/data-art/grid-input/'
str art_input_cvmfs = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/'

Detailed Description

Common variables and functions used in Trigger ART test steering

Function Documentation

◆ art_result()

python.TrigValSteering.Common.art_result ( result,
name )
Print art-result to stdout and summary log file

Definition at line 42 of file Common.py.

42def art_result(result, name):
43 '''Print art-result to stdout and summary log file'''
44
45 line = 'art-result: {} {}\n'.format(result, name)
46 sys.stdout.write(line)
47 with open(art_result_summary, 'a') as summary:
48 summary.write(line)
49
50

◆ clear_art_summary()

python.TrigValSteering.Common.clear_art_summary ( )
Remove art-result summary file produced by the art_result function

Definition at line 51 of file Common.py.

51def clear_art_summary():
52 '''Remove art-result summary file produced by the art_result function'''
53
54 if os.path.isfile(art_result_summary):
55 os.remove(art_result_summary)
56
57

◆ find_file()

python.TrigValSteering.Common.find_file ( pattern)
Bash inline command frequently used in multi-step tests
to pass the output of one step to the input of another
based on a name pattern rather than a fixed full file name

Definition at line 58 of file Common.py.

58def find_file(pattern):
59 '''
60 Bash inline command frequently used in multi-step tests
61 to pass the output of one step to the input of another
62 based on a name pattern rather than a fixed full file name
63 '''
64 return '`find . -name \'{:s}\' | tail -n 1`'.format(pattern)
65

◆ find_file_in_path()

python.TrigValSteering.Common.find_file_in_path ( filename,
path_env_var )
Find filename in search path given by environment variable

Definition at line 66 of file Common.py.

66def find_file_in_path(filename, path_env_var):
67 '''Find filename in search path given by environment variable'''
68
69 # same as AthenaCommon.unixtools.FindFile but don't want AthenaCommon dependency
70 for path in os.environ[path_env_var].split(os.pathsep):
71 f = os.path.join( path, filename )
72 if os.access(f, os.R_OK):
73 return f
74 return None
75
76
77@lru_cache
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ get_logger()

python.TrigValSteering.Common.get_logger ( )
Default TrigValSteering logger

Definition at line 33 of file Common.py.

33def get_logger():
34 '''Default TrigValSteering logger'''
35 logging.basicConfig(stream=sys.stdout,
36 format='%(asctime)s %(name)s %(levelname)-8s %(message)s',
37 datefmt='%Y-%m-%dT%H%M%S %Z',
38 level=trigvalsteering_logging_level)
39 return logging.getLogger('TrigValSteering')
40
41

◆ running_in_CI()

python.TrigValSteering.Common.running_in_CI ( )

Definition at line 78 of file Common.py.

78def running_in_CI():
79 return os.environ.get('gitlabTargetBranch') is not None

Variable Documentation

◆ art_input_cvmfs

str python.TrigValSteering.Common.art_input_cvmfs = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/'

Definition at line 30 of file Common.py.

◆ art_input_eos

str python.TrigValSteering.Common.art_input_eos = '/eos/atlas/atlascerngroupdisk/data-art/grid-input/'

Definition at line 29 of file Common.py.

◆ art_result_summary

str python.TrigValSteering.Common.art_result_summary = 'art-result-summary.log'

Definition at line 26 of file Common.py.

◆ package_prefix_dict

dict python.TrigValSteering.Common.package_prefix_dict
Initial value:
1= {'TriggerTest': 'trig_',
2 'TrigP1Test': 'trigP1_',
3 'TrigAnalysisTest': 'trigAna_',
4 'TrigInDetValidation': 'trigID_',
5 'TrigGpuTest': 'trigGPU_',}

Definition at line 19 of file Common.py.

◆ trigvalsteering_logging_level

python.TrigValSteering.Common.trigvalsteering_logging_level = logging.INFO

Definition at line 16 of file Common.py.