Skip to content

Commit 8b39075

Browse files
committed
Streamline remote workflow.
1 parent 7ff445d commit 8b39075

16 files changed

+784
-496
lines changed

dhi/__init__.py

+45
Original file line numberDiff line numberDiff line change
@@ -1 +1,46 @@
11
# coding: utf-8
2+
3+
"""
4+
CMS Di-Higgs inference tools.
5+
"""
6+
7+
import os
8+
import re
9+
10+
import law
11+
12+
13+
# meta infos
14+
__author__ = "The CMS HH Team"
15+
__copyright__ = "Copyright 2020-2023"
16+
__credits__ = [
17+
"Marcel Rieger",
18+
"Peter Fackeldey",
19+
"Alexandra Carvalho Antunes De Oliveira",
20+
"Torben Lange",
21+
]
22+
__contact__ = "https://gitlab.cern.ch/hh/tools/inference"
23+
__license__ = "BSD-3-Clause"
24+
__status__ = "Development"
25+
__version__ = "0.1.0"
26+
27+
# extended version info
28+
m = re.match(r"^(\d+)\.(\d+)\.(\d+)(-.+)?$", __version__)
29+
version = tuple(map(int, m.groups()[:3])) + (m.group(4),)
30+
31+
# environment flags
32+
dhi_remote_job = str(os.getenv("DHI_REMOTE_JOB", "0")).lower() in ("1", "true", "yes")
33+
dhi_has_gfal = str(os.getenv("DHI_HAS_GFAL", "0")).lower() in ("1", "true", "yes")
34+
dhi_htcondor_flavor = os.getenv("DHI_HTCONDOR_FLAVOR", "cern")
35+
36+
# law contrib packages
37+
law.contrib.load(
38+
"cms", "git", "gfal", "htcondor", "numpy", "slack", "telegram", "root", "tasks", "wlcg",
39+
)
40+
41+
# initialize wlcg file systems once so that their cache cleanup is triggered if configured
42+
if law.config.has_option("outputs", "wlcg_file_systems"):
43+
wlcg_file_systems = [
44+
law.wlcg.WLCGFileSystem(fs.strip())
45+
for fs in law.config.get_expanded("outputs", "wlcg_file_systems", split_csv=True)
46+
]

0 commit comments

Comments
 (0)