triggerflow 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trigger_loader/cluster_manager.py +3 -3
- trigger_loader/loader.py +55 -3
- {triggerflow-0.2.1.dist-info → triggerflow-0.2.2.dist-info}/METADATA +1 -1
- {triggerflow-0.2.1.dist-info → triggerflow-0.2.2.dist-info}/RECORD +7 -7
- {triggerflow-0.2.1.dist-info → triggerflow-0.2.2.dist-info}/WHEEL +0 -0
- {triggerflow-0.2.1.dist-info → triggerflow-0.2.2.dist-info}/entry_points.txt +0 -0
- {triggerflow-0.2.1.dist-info → triggerflow-0.2.2.dist-info}/top_level.txt +0 -0
|
@@ -4,9 +4,6 @@ import logging
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
from dask.distributed import Client, LocalCluster
|
|
7
|
-
from dask_cuda import LocalCUDACluster
|
|
8
|
-
from dask_jobqueue import HTCondorCluster
|
|
9
|
-
from dask_kubernetes import KubeCluster
|
|
10
7
|
|
|
11
8
|
logger = logging.getLogger(__name__)
|
|
12
9
|
|
|
@@ -63,15 +60,18 @@ class ClusterManager:
|
|
|
63
60
|
self.cluster = LocalCluster(**self.cluster_config)
|
|
64
61
|
|
|
65
62
|
elif ct == "condor":
|
|
63
|
+
from dask_jobqueue import HTCondorCluster
|
|
66
64
|
self.cluster = HTCondorCluster(**self.cluster_config)
|
|
67
65
|
if self.jobs and self.jobs > 0:
|
|
68
66
|
# Scale to the requested number of jobs
|
|
69
67
|
self.cluster.scale(jobs=self.jobs)
|
|
70
68
|
|
|
71
69
|
elif ct == "cuda":
|
|
70
|
+
from dask_cuda import LocalCUDACluster
|
|
72
71
|
self.cluster = LocalCUDACluster(**self.cluster_config)
|
|
73
72
|
|
|
74
73
|
elif ct == "kubernetes":
|
|
74
|
+
from dask_kubernetes import KubeCluster
|
|
75
75
|
self.cluster = KubeCluster(**self.cluster_config)
|
|
76
76
|
if self.jobs and self.jobs > 0:
|
|
77
77
|
try:
|
trigger_loader/loader.py
CHANGED
|
@@ -45,8 +45,58 @@ class TriggerLoader:
|
|
|
45
45
|
)
|
|
46
46
|
|
|
47
47
|
def _load_sample_json(self, sample_json: str) -> dict:
|
|
48
|
+
"""
|
|
49
|
+
Loads the JSON and resolves file paths using the priority:
|
|
50
|
+
1. Explicit 'files' list or directory path (Local/Explicit)
|
|
51
|
+
2. 'DAS' query (Remote Fallback)
|
|
52
|
+
|
|
53
|
+
Returns the canonical coffea fileset format: {dataset_name: [file_path_list]}.
|
|
54
|
+
"""
|
|
55
|
+
import glob
|
|
56
|
+
import os
|
|
57
|
+
|
|
58
|
+
# Helper function definition needed here if it's not imported:
|
|
59
|
+
# def _fetch_files_from_das(das_query: str) -> list[str]: ... (placeholder or actual implementation)
|
|
60
|
+
|
|
48
61
|
with open(sample_json) as f:
|
|
49
|
-
|
|
62
|
+
full_data = json.load(f)
|
|
63
|
+
dataset_metadata = full_data.get("samples", full_data)
|
|
64
|
+
|
|
65
|
+
fileset = {}
|
|
66
|
+
for ds_name, ds_info in dataset_metadata.items():
|
|
67
|
+
files = []
|
|
68
|
+
|
|
69
|
+
if "files" in ds_info:
|
|
70
|
+
file_info = ds_info["files"]
|
|
71
|
+
|
|
72
|
+
if isinstance(file_info, list):
|
|
73
|
+
files = file_info
|
|
74
|
+
|
|
75
|
+
elif isinstance(file_info, str):
|
|
76
|
+
if os.path.isdir(file_info):
|
|
77
|
+
path_glob = os.path.join(file_info, "*.root")
|
|
78
|
+
files = glob.glob(path_glob)
|
|
79
|
+
logger.info(f"Resolved {len(files)} files from directory {file_info}.")
|
|
80
|
+
else:
|
|
81
|
+
files = [file_info]
|
|
82
|
+
|
|
83
|
+
if files:
|
|
84
|
+
logger.info(f"Using {len(files)} local/explicit files for {ds_name}.")
|
|
85
|
+
|
|
86
|
+
if not files and "DAS" in ds_info:
|
|
87
|
+
try:
|
|
88
|
+
files = _fetch_files_from_das(ds_info["DAS"])
|
|
89
|
+
logger.info(f"Resolved {len(files)} files via DAS for {ds_name}.")
|
|
90
|
+
except NameError:
|
|
91
|
+
logger.error("DAS fetching skipped: _fetch_files_from_das is not defined.")
|
|
92
|
+
|
|
93
|
+
if not files:
|
|
94
|
+
logger.warning(f"No files found for dataset: {ds_name}. Skipping.")
|
|
95
|
+
continue
|
|
96
|
+
|
|
97
|
+
fileset[ds_name] = files
|
|
98
|
+
|
|
99
|
+
return fileset
|
|
50
100
|
|
|
51
101
|
def _write_run_metadata_file(self, path: str, duration_s: float | None = None):
|
|
52
102
|
meta_path = f"{path}/run_metadata.json"
|
|
@@ -58,9 +108,11 @@ class TriggerLoader:
|
|
|
58
108
|
json.dump(data, f, indent=2)
|
|
59
109
|
|
|
60
110
|
def _run(self, runner: processor.Runner, label: str):
|
|
61
|
-
logger.log(f"Starting processing ({label})...")
|
|
111
|
+
logger.log(logging.INFO, f"Starting processing ({label})...")
|
|
62
112
|
start = time.time()
|
|
63
113
|
proc = self._build_processor()
|
|
114
|
+
print(self.fileset)
|
|
115
|
+
|
|
64
116
|
acc = runner(
|
|
65
117
|
self.fileset,
|
|
66
118
|
treename="Events",
|
|
@@ -68,7 +120,7 @@ class TriggerLoader:
|
|
|
68
120
|
)
|
|
69
121
|
elapsed = time.time() - start
|
|
70
122
|
self._write_run_metadata_file(self.output_path, elapsed)
|
|
71
|
-
logger.log(f"Finished in {elapsed:.2f}s (run_uuid={self.run_uuid})")
|
|
123
|
+
logger.log(logging.INFO, f"Finished in {elapsed:.2f}s (run_uuid={self.run_uuid})")
|
|
72
124
|
return acc
|
|
73
125
|
|
|
74
126
|
def run_distributed(self, cluster_type: str, cluster_config: dict,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
trigger_dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
trigger_dataset/core.py,sha256=ZX96U6rWxxfCatDQbst6IRZvtlyDj1_2JA7stPydGTQ,2645
|
|
3
3
|
trigger_loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
trigger_loader/cluster_manager.py,sha256=
|
|
5
|
-
trigger_loader/loader.py,sha256=
|
|
4
|
+
trigger_loader/cluster_manager.py,sha256=XgmY1xeW8zrpQDJqssKamWzjn6TQ60NGNzpcdZwL6NE,3617
|
|
5
|
+
trigger_loader/loader.py,sha256=wMkeZ3k36wpxt-B8OpKOa6j7z0-fnJUqQ-5AbVjNpBM,5158
|
|
6
6
|
trigger_loader/processor.py,sha256=cvBfYmvcr4FLzOHgGE50oy7EkFzFaV80Z_66amqfsEY,7724
|
|
7
7
|
triggerflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
triggerflow/cli.py,sha256=ZNQb3XQN8Ir6Hp6KX_ugec9bm2kqxLNZ0KdVGJmnqFA,4498
|
|
@@ -90,8 +90,8 @@ triggerflow/templates/makefile,sha256=A-aetsLC51Bop0T_-yPY8Z8Hg29ApN4YPvKx_jjPuH
|
|
|
90
90
|
triggerflow/templates/makefile_version,sha256=6kFc_u2oiM9l2rH7RK_BLzdZu1ZEK8PQTQKGBLRY0v4,328
|
|
91
91
|
triggerflow/templates/model_template.cpp,sha256=jMNRcO7NgC6I9Wd2BV3Bim-P1qPsAl_oeVQ8KofQGEw,1807
|
|
92
92
|
triggerflow/templates/scales.h,sha256=MFcB5S0DEvfzHuUhyZqILR0O4ktugOG-fLnuCDUUewM,373
|
|
93
|
-
triggerflow-0.2.
|
|
94
|
-
triggerflow-0.2.
|
|
95
|
-
triggerflow-0.2.
|
|
96
|
-
triggerflow-0.2.
|
|
97
|
-
triggerflow-0.2.
|
|
93
|
+
triggerflow-0.2.2.dist-info/METADATA,sha256=08dT-O69f0YlTIWRjJHgYg5bE6jTPBovQmcq6vidK9M,2921
|
|
94
|
+
triggerflow-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
95
|
+
triggerflow-0.2.2.dist-info/entry_points.txt,sha256=5QSV9YDseB_FqgVh9q10BdL4b1I6t68rGwPLXgVL60g,53
|
|
96
|
+
triggerflow-0.2.2.dist-info/top_level.txt,sha256=cX0jkuM9tfxGp002ZBQ1AYgx-6D_NgBtomgPL0WA9bE,43
|
|
97
|
+
triggerflow-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|