|
ATLAS Offline Software
|
◆ generatorsGetFromMetadata()
def python.Versioning.generatorsGetFromMetadata |
( |
|
metadataString | ) |
|
Definition at line 32 of file Versioning.py.
34 metadataStringSplit = metadataString.split(
"+")
35 for s
in metadataStringSplit:
36 match = versionRegex.search(s)
38 s = s.replace(match.group(0),
"")
39 output[s] = match.group(1)
◆ generatorsGetInitialVersionedDictionary()
def python.Versioning.generatorsGetInitialVersionedDictionary |
( |
|
generators | ) |
|
Definition at line 25 of file Versioning.py.
27 for generator
in generators:
28 env_variable = f
"{generator.upper()}VER"
29 output[generator] =
getenv(env_variable,
None)
◆ generatorsVersionedString()
def python.Versioning.generatorsVersionedString |
( |
|
generatorsVersionedList | ) |
|
◆ generatorsVersionedStringList()
def python.Versioning.generatorsVersionedStringList |
( |
|
generatorsDictionary | ) |
|
Definition at line 44 of file Versioning.py.
46 for generator, version
in generatorsDictionary.items():
47 if version
is not None:
48 list.append(f
"{generator}(v.{version})")
50 list.append(generator)
◆ GeneratorVersioningFixCfg()
def python.Versioning.GeneratorVersioningFixCfg |
( |
|
flags | ) |
|
Definition at line 57 of file Versioning.py.
58 from AthenaCommon.Logging
import logging
59 log = logging.getLogger(
"GeneratorsInfo")
60 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
62 generatorsData = flags.Input.GeneratorsInfo
63 log.info(f
"Generators data: {generatorsData}")
65 missingVersion =
False
66 for k, v
in generatorsData.items():
67 if v
is None and k
not in ignoredGenerators:
70 if not missingVersion:
73 log.info(
"At least one MC generator is missing version information. Attempting to fix...")
75 from PyUtils.AMITagHelperConfig
import inputAMITags
78 if tags
and tags[0].startswith(
"e"):
82 if tag
not in releaseDataDict:
83 log.warning(f
"Could not find release data for tag {tag}.")
86 releaseData = releaseDataDict[tag]
87 for k, v
in generatorsData.items():
88 if v
is None and k
not in ignoredGenerators
and k
in releaseData:
89 log.info(f
"Setting version for {k} to {releaseData[k]}.")
90 generatorsData[k] = releaseData[k]
94 from EventInfoMgt.TagInfoMgrConfig
import TagInfoMgrCfg
◆ legacyReleaseData()
def python.Versioning.legacyReleaseData |
( |
| ) |
|
Definition at line 10 of file Versioning.py.
11 from pathlib
import Path
12 from PathResolver
import PathResolver
15 with filePath.open()
as f:
16 header = f.readline().strip().
split(
",")
17 generators = header[2:]
19 line = line.strip().
split(
",")
20 item = {generator: version
for generator, version
in zip(generators, line[2:])}
21 item[
'version'] = line[0]
◆ ignoredGenerators
list python.Versioning.ignoredGenerators = ["Pythia8B", "Powheg"] |
◆ versionRegex
python.Versioning.versionRegex = re.compile(r'\(v\.(.*)\)$') |
static std::string FindCalibFile(const std::string &logical_file_name)
def TagInfoMgrCfg(flags, tagValuePairs={})
def generatorsVersionedString(generatorsVersionedList)
def generatorsGetInitialVersionedDictionary(generators)
def GeneratorVersioningFixCfg(flags)
std::string join(const std::vector< std::string > &v, const char c=',')
def generatorsVersionedStringList(generatorsDictionary)
std::string getenv(const std::string &variableName)
get an environment variable
def inputAMITags(flags, fixBroken=False, silent=False)
def generatorsGetFromMetadata(metadataString)