3 from typing
import List, Union
10 any(v.startswith(
"G4")
for v
in os.environ.keys())
11 or "GEANT4_DATA_DIR" in os.environ
26 if "ROOTSYS" in os.environ:
30 "ROOT likely built without/with incompatible PyROOT. Skipping tests that need ROOT"
33 dd4hepEnabled =
"DD4hep_DIR" in os.environ
52 edm4hepEnabled =
False
67 pythia8Enabled =
False
70 exatrkxEnabled = shutil.which(
"nvidia-smi")
is not None
75 exatrkxEnabled =
False
81 except ModuleNotFoundError:
84 isCI = os.environ.get(
"CI",
"false") ==
"true"
87 for k, v
in dict(locals()).
items():
88 if k.endswith(
"Enabled"):
94 collections: List[str]
98 collections: Union[List[str], str],
100 level=acts.logging.INFO,
104 if isinstance(collections, str):
105 self.collections = [collections]
107 self.collections = collections
108 IAlgorithm.__init__(self, name=name, level=level, *args, **kwargs)
111 for collection
in self.collections:
112 assert ctx.eventStore.exists(collection), f
"{collection} does not exist"
114 return acts.examples.ProcessCode.SUCCESS
117 doHashChecks = os.environ.get(
"ROOT_HASH_CHECKS",
"") !=
"" or "CI" in os.environ
120 @contextlib.contextmanager
122 prev = acts.logging.getFailureThreshold()
123 if enabled
and prev != level:
125 acts.logging.setFailureThreshold(level)
129 "Runtime log failure threshold could not be set. "
130 "Compile-time value is probably set via CMake, i.e. "
131 f
"`ACTS_LOG_FAILURE_THRESHOLD={acts.logging.getFailureThreshold().name}` is set, "
132 "or `ACTS_ENABLE_LOG_FAILURE_THRESHOLD=OFF`. "
133 "The pytest test-suite will not work in this configuration."
137 acts.logging.setFailureThreshold(prev)