colliderml 0.4.1__tar.gz → 0.4.2__tar.gz

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.
Files changed (156) hide show
  1. colliderml-0.4.2/MANIFEST.in +13 -0
  2. {colliderml-0.4.1/colliderml.egg-info → colliderml-0.4.2}/PKG-INFO +1 -1
  3. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/cli.py +1 -1
  4. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/remote/_client.py +1 -1
  5. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/simulate/docker.py +22 -32
  6. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/simulate/pipeline.py +11 -38
  7. {colliderml-0.4.1 → colliderml-0.4.2/colliderml.egg-info}/PKG-INFO +1 -1
  8. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml.egg-info/SOURCES.txt +13 -56
  9. {colliderml-0.4.1 → colliderml-0.4.2}/setup.py +1 -1
  10. colliderml-0.4.2/tests/pipeline/__init__.py +0 -0
  11. colliderml-0.4.2/tests/pipeline/_http.py +59 -0
  12. colliderml-0.4.2/tests/pipeline/conftest.py +163 -0
  13. colliderml-0.4.2/tests/pipeline/test_e2e_core_loop.py +72 -0
  14. colliderml-0.4.2/tests/pipeline/test_stage_benchmark_tasks.py +39 -0
  15. colliderml-0.4.2/tests/pipeline/test_stage_import.py +55 -0
  16. colliderml-0.4.2/tests/pipeline/test_stage_leaderboard.py +51 -0
  17. colliderml-0.4.2/tests/pipeline/test_stage_load.py +49 -0
  18. colliderml-0.4.2/tests/pipeline/test_stage_simulate_local.py +59 -0
  19. colliderml-0.4.2/tests/pipeline/test_stage_simulate_remote.py +74 -0
  20. colliderml-0.4.2/tests/pipeline/test_stage_tasks_evaluate.py +88 -0
  21. colliderml-0.4.2/tests/pipeline/test_stage_tasks_submit.py +51 -0
  22. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_simulate_api.py +0 -1
  23. colliderml-0.4.1/MANIFEST.in +0 -9
  24. colliderml-0.4.1/docs/.vitepress/cache/deps/_metadata.json +0 -31
  25. colliderml-0.4.1/docs/.vitepress/cache/deps/chunk-VJWGEPT5.js +0 -12542
  26. colliderml-0.4.1/docs/.vitepress/cache/deps/chunk-VJWGEPT5.js.map +0 -7
  27. colliderml-0.4.1/docs/.vitepress/cache/deps/package.json +0 -3
  28. colliderml-0.4.1/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -163
  29. colliderml-0.4.1/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
  30. colliderml-0.4.1/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -9188
  31. colliderml-0.4.1/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
  32. colliderml-0.4.1/docs/.vitepress/cache/deps/vue.js +0 -343
  33. colliderml-0.4.1/docs/.vitepress/cache/deps/vue.js.map +0 -7
  34. colliderml-0.4.1/docs/.vitepress/components/AboutData.vue +0 -88
  35. colliderml-0.4.1/docs/.vitepress/components/DataConfig.vue +0 -868
  36. colliderml-0.4.1/docs/.vitepress/config.ts +0 -124
  37. colliderml-0.4.1/docs/.vitepress/shims-vue.d.ts +0 -5
  38. colliderml-0.4.1/docs/.vitepress/theme/custom.css +0 -21
  39. colliderml-0.4.1/docs/.vitepress/theme/index.ts +0 -14
  40. colliderml-0.4.1/docs/acat.md +0 -66
  41. colliderml-0.4.1/docs/ais25.md +0 -73
  42. colliderml-0.4.1/docs/appendices.md +0 -17
  43. colliderml-0.4.1/docs/changelog.md +0 -83
  44. colliderml-0.4.1/docs/ctd25.md +0 -64
  45. colliderml-0.4.1/docs/guide/installation.md +0 -135
  46. colliderml-0.4.1/docs/guide/introduction.md +0 -48
  47. colliderml-0.4.1/docs/guide/quickstart.md +0 -344
  48. colliderml-0.4.1/docs/guide/remote-simulation.md +0 -206
  49. colliderml-0.4.1/docs/guide/simulation.md +0 -178
  50. colliderml-0.4.1/docs/guide/tasks.md +0 -150
  51. colliderml-0.4.1/docs/guide/tutorial.md +0 -564
  52. colliderml-0.4.1/docs/index.md +0 -77
  53. colliderml-0.4.1/docs/internal/admin.md +0 -85
  54. colliderml-0.4.1/docs/internal/backend.md +0 -182
  55. colliderml-0.4.1/docs/internal/container-image.md +0 -109
  56. colliderml-0.4.1/docs/internal/deployment.md +0 -103
  57. colliderml-0.4.1/docs/internal/overview.md +0 -29
  58. colliderml-0.4.1/docs/internal/sfapi.md +0 -121
  59. colliderml-0.4.1/docs/library/benchmarks.md +0 -24
  60. colliderml-0.4.1/docs/library/cli.md +0 -125
  61. colliderml-0.4.1/docs/library/exploding.md +0 -58
  62. colliderml-0.4.1/docs/library/loading.md +0 -45
  63. colliderml-0.4.1/docs/library/overview.md +0 -63
  64. colliderml-0.4.1/docs/library/physics.md +0 -63
  65. colliderml-0.4.1/docs/library/remote.md +0 -190
  66. colliderml-0.4.1/docs/library/simulate.md +0 -226
  67. colliderml-0.4.1/docs/library/tasks.md +0 -250
  68. colliderml-0.4.1/docs/package-lock.json +0 -1700
  69. colliderml-0.4.1/docs/package.json +0 -24
  70. colliderml-0.4.1/docs/public/.nojekyll +0 -1
  71. colliderml-0.4.1/docs/public/logo.png +0 -0
  72. colliderml-0.4.1/docs/public/size-estimates.json +0 -14
  73. colliderml-0.4.1/docs/spaces/event-display.md +0 -68
  74. colliderml-0.4.1/docs/spaces/leaderboard.md +0 -83
  75. colliderml-0.4.1/docs/spaces/model-zoo.md +0 -68
  76. colliderml-0.4.1/docs/spaces/overview.md +0 -103
  77. colliderml-0.4.1/docs/spaces/simulation-form.md +0 -93
  78. colliderml-0.4.1/docs/tsconfig.json +0 -18
  79. {colliderml-0.4.1 → colliderml-0.4.2}/LICENSE +0 -0
  80. {colliderml-0.4.1 → colliderml-0.4.2}/README.md +0 -0
  81. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/__init__.py +0 -0
  82. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/_load.py +0 -0
  83. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/__init__.py +0 -0
  84. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/data/__init__.py +0 -0
  85. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/data/config.py +0 -0
  86. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/data/loader_config.py +0 -0
  87. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/data/manifest.py +0 -0
  88. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/hf_download.py +0 -0
  89. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/loader.py +0 -0
  90. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/core/tables.py +0 -0
  91. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/physics/__init__.py +0 -0
  92. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/physics/calibration.py +0 -0
  93. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/physics/constants.py +0 -0
  94. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/physics/decay.py +0 -0
  95. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/physics/detector_enums.py +0 -0
  96. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/physics/pileup.py +0 -0
  97. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/polars/__init__.py +0 -0
  98. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/polars/flatten.py +0 -0
  99. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/remote/__init__.py +0 -0
  100. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/remote/_auth.py +0 -0
  101. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/simulate/__init__.py +0 -0
  102. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/simulate/api.py +0 -0
  103. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/simulate/presets.py +0 -0
  104. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/simulate/presets.yaml +0 -0
  105. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/__init__.py +0 -0
  106. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/_base.py +0 -0
  107. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/_loading.py +0 -0
  108. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/anomaly/__init__.py +0 -0
  109. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/anomaly/baselines/__init__.py +0 -0
  110. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/anomaly/baselines/isoforest.py +0 -0
  111. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/anomaly/task.py +0 -0
  112. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/jets/__init__.py +0 -0
  113. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/jets/baselines/__init__.py +0 -0
  114. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/jets/baselines/bdt.py +0 -0
  115. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/jets/metrics.py +0 -0
  116. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/jets/task.py +0 -0
  117. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/systems/__init__.py +0 -0
  118. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/systems/dataloading.py +0 -0
  119. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/systems/latency.py +0 -0
  120. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/systems/smallmodel.py +0 -0
  121. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/tracking/__init__.py +0 -0
  122. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/tracking/baselines/__init__.py +0 -0
  123. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/tracking/baselines/ckf.py +0 -0
  124. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/tracking/baselines/oracle.py +0 -0
  125. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/tracking/metrics.py +0 -0
  126. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/tasks/tracking/task.py +0 -0
  127. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/utils/__init__.py +0 -0
  128. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/viz/__init__.py +0 -0
  129. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml/viz/plotting_utils.py +0 -0
  130. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml.egg-info/dependency_links.txt +0 -0
  131. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml.egg-info/entry_points.txt +0 -0
  132. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml.egg-info/requires.txt +0 -0
  133. {colliderml-0.4.1 → colliderml-0.4.2}/colliderml.egg-info/top_level.txt +0 -0
  134. {colliderml-0.4.1 → colliderml-0.4.2}/setup.cfg +0 -0
  135. {colliderml-0.4.1 → colliderml-0.4.2}/tests/__init__.py +0 -0
  136. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_calo_calibration.py +0 -0
  137. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_cli_download.py +0 -0
  138. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_cli_simulate.py +0 -0
  139. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_decay_traversal.py +0 -0
  140. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_download_benchmark.py +0 -0
  141. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_download_event_range.py +0 -0
  142. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_huggingface_loader.py +0 -0
  143. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_load_unified.py +0 -0
  144. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_pileup_subsample.py +0 -0
  145. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_polars_flatten.py +0 -0
  146. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_polars_loader.py +0 -0
  147. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_remote_client.py +0 -0
  148. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_simulate_docker.py +0 -0
  149. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_simulate_presets.py +0 -0
  150. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_jets_metrics.py +0 -0
  151. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_loading.py +0 -0
  152. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_registry.py +0 -0
  153. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_tracking_baselines.py +0 -0
  154. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_tracking_env_override.py +0 -0
  155. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_tracking_explode.py +0 -0
  156. {colliderml-0.4.1 → colliderml-0.4.2}/tests/test_tasks_tracking_metrics.py +0 -0
@@ -0,0 +1,13 @@
1
+ include LICENSE
2
+ include README.md
3
+ include setup.cfg
4
+ recursive-include tests *
5
+ recursive-include colliderml/simulate *.yaml
6
+ # The VitePress site (docs/) is NOT part of the Python package — it pulled
7
+ # ~5 MB of detector images / event JSON (and a local node_modules with
8
+ # esbuild/TypeScript binaries) into the sdist. Keep it out.
9
+ prune docs
10
+ global-exclude *.py[cod]
11
+ global-exclude __pycache__
12
+ global-exclude *.so
13
+ global-exclude node_modules
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: colliderml
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A modern machine learning library for high-energy physics data analysis
5
5
  Home-page: https://github.com/OpenDataDetector/ColliderML
6
6
  Author: Daniel Murnane
@@ -326,7 +326,7 @@ def build_parser() -> argparse.ArgumentParser:
326
326
  p_bal.add_argument(
327
327
  "--backend-url",
328
328
  default=None,
329
- help="Override the backend URL (default: $COLLIDERML_BACKEND or https://api.colliderml.com).",
329
+ help="Override the backend URL (default: $COLLIDERML_BACKEND or https://colliderml-backend.onrender.com).",
330
330
  )
331
331
  p_bal.add_argument(
332
332
  "--json",
@@ -18,7 +18,7 @@ from colliderml.remote._auth import auth_headers, require_hf_token
18
18
  #: Default backend URL. Overridable with ``$COLLIDERML_BACKEND`` or the
19
19
  #: ``backend_url=`` keyword on every client entry point.
20
20
  DEFAULT_BACKEND_URL = os.environ.get(
21
- "COLLIDERML_BACKEND", "https://api.colliderml.com"
21
+ "COLLIDERML_BACKEND", "https://colliderml-backend.onrender.com"
22
22
  )
23
23
 
24
24
  #: Interval between poll cycles in :func:`wait_for`.
@@ -26,9 +26,15 @@ from dataclasses import dataclass
26
26
  from pathlib import Path
27
27
  from typing import Callable, List, Optional
28
28
 
29
- #: Default OpenDataDetector software image. Pinned to a known-good tag;
29
+ #: Default OpenDataDetector software image. Pinned to a known-good digest;
30
30
  #: override with ``image=...`` on :func:`simulate` or the ``--image`` CLI flag.
31
- DEFAULT_IMAGE = "ghcr.io/opendatadetector/sw:0.2.2_linux-ubuntu24.04_gcc-13.3.0"
31
+ #:
32
+ #: This is the native-Arrow image: ACTS built with the Arrow/Parquet plugin so
33
+ #: the digitization stage writes parquet directly (replacing convert_all.py,
34
+ #: which crashed on merged-cluster measurements). Pinned by digest to the
35
+ #: linux-ubuntu24.04 (x86_64) build from OpenDataDetector/sw PR #3 while the
36
+ #: upstream Arrow PRs land; switch to the released ``sw`` tag once they merge.
37
+ DEFAULT_IMAGE = "ghcr.io/opendatadetector/sw@sha256:20e4df7b0d6befd70ce0113d852350b25cbd9aac659d1bc530036a2c85a68f89"
32
38
 
33
39
  #: Git repository that houses the simulation pipeline scripts and configs.
34
40
  COLLIDERML_PRODUCTION_REPO = "https://github.com/OpenDataDetector/colliderml-production.git"
@@ -37,11 +43,13 @@ COLLIDERML_PRODUCTION_REPO = "https://github.com/OpenDataDetector/colliderml-pro
37
43
  #: this. Can also be overridden per-invocation via ``COLLIDERML_PRODUCTION_REF``.
38
44
  #:
39
45
  #: .. note::
40
- #: For v0.4.0+ this is pinned to the ``pipeline-v0.1.0`` tag on the
41
- #: colliderml-production repo so local sim is reproducible across
42
- #: upstream pipeline changes. Bump in lockstep with future pipeline
43
- #: tags when the upstream cuts a new pipeline release.
44
- COLLIDERML_PRODUCTION_REF = "pipeline-v0.1.0"
46
+ #: Pinned to the ``pipeline-v0.2.1`` tag on the colliderml-production repo:
47
+ #: the digitization stage emits ACTS-native parquet directly (merging on),
48
+ #: which replaces the convert_all.py post-processing, and uses ODD v5.0.0
49
+ #: (the released-dataset tag). Requires the native-Arrow :data:`DEFAULT_IMAGE`.
50
+ #: Bump in lockstep with future pipeline tags when the upstream cuts a new
51
+ #: pipeline release.
52
+ COLLIDERML_PRODUCTION_REF = "pipeline-v0.2.1"
45
53
 
46
54
  #: Environment variable override for the pinned ref (useful for testing
47
55
  #: against an in-flight branch of the production repo).
@@ -297,36 +305,18 @@ def clone_colliderml_production(
297
305
  def _ensure_external_caches(prod_root: Path) -> Path:
298
306
  """Populate the on-host ``.cache`` directory inside the production checkout.
299
307
 
300
- Mirrors the behaviour of the original production-repo ``_docker.py``:
301
- clones OpenDataDetector v4.0.4 and MG5aMC_PY8_interface into
302
- ``<prod_root>/.cache/`` so the container can find them at
303
- ``/cache/odd-v4`` and ``/cache/MG5aMC_PY8_interface``.
308
+ Clones MG5aMC_PY8_interface into ``<prod_root>/.cache/`` so the container
309
+ can find it at ``/cache/MG5aMC_PY8_interface``.
304
310
 
305
- These are cloned on the *host* (where network works) because the
306
- container itself has no outbound network access.
311
+ OpenDataDetector is *not* cloned here: the sw image bakes ODD v5.0.0 in at
312
+ ``/opt/odd`` (the tag the released dataset was generated with), and the
313
+ in-container ``setup_container_env.sh`` uses it directly — or, on an image
314
+ without a baked ODD, clones v5.0.0 itself (resolving the LFS material map,
315
+ since git-lfs lives in the container, not necessarily on the host).
307
316
  """
308
317
  cache_dir = prod_root / ".cache"
309
318
  cache_dir.mkdir(exist_ok=True)
310
319
 
311
- odd_marker = cache_dir / "odd-v4" / "xml" / "OpenDataDetector.xml"
312
- if not odd_marker.exists():
313
- print("Cloning OpenDataDetector v4.0.4 into simulate cache ...")
314
- subprocess.run(
315
- [
316
- "git",
317
- "clone",
318
- "--quiet",
319
- "--depth",
320
- "1",
321
- "--branch",
322
- "v4.0.4",
323
- "https://gitlab.cern.ch/acts/OpenDataDetector.git",
324
- str(cache_dir / "odd-v4"),
325
- ],
326
- capture_output=True,
327
- timeout=300,
328
- )
329
-
330
320
  mg5_marker = cache_dir / "MG5aMC_PY8_interface" / "MG5aMC_PY8_interface.cc"
331
321
  if not mg5_marker.exists():
332
322
  print("Cloning MG5aMC_PY8_interface into simulate cache ...")
@@ -46,6 +46,13 @@ class Stage:
46
46
  #:
47
47
  #: Ordering matters — stages run sequentially, and later stages depend on
48
48
  #: artefacts from earlier ones.
49
+ #:
50
+ #: Digitization & Reconstruction is the final stage: it writes the
51
+ #: tracker_hits / particles / tracks / calo_hits parquet directly via the ACTS
52
+ #: Arrow plugin (requires the native-Arrow image, see
53
+ #: :data:`~colliderml.simulate.docker.DEFAULT_IMAGE`). This replaced the former
54
+ #: separate "Parquet Conversion" (convert_all.py) stage, which crashed on
55
+ #: merged-cluster measurements.
49
56
  CHANNEL_STAGES: Dict[str, Tuple[Stage, ...]] = {
50
57
  "higgs_portal": (
51
58
  Stage(
@@ -66,12 +73,6 @@ CHANNEL_STAGES: Dict[str, Tuple[Stage, ...]] = {
66
73
  script="simulation/digi_and_reco.py",
67
74
  config="digitization_config.yaml",
68
75
  ),
69
- Stage(
70
- name="Parquet Conversion",
71
- stage="convert_all",
72
- script="postprocessing/convert_all.py",
73
- config="convert_all.yaml",
74
- ),
75
76
  ),
76
77
  "ttbar": (
77
78
  Stage(
@@ -104,39 +105,11 @@ CHANNEL_STAGES: Dict[str, Tuple[Stage, ...]] = {
104
105
  script="simulation/digi_and_reco.py",
105
106
  config="digitization_config.yaml",
106
107
  ),
107
- Stage(
108
- name="Parquet Conversion",
109
- stage="convert_all",
110
- script="postprocessing/convert_all.py",
111
- config="convert_all.yaml",
112
- ),
113
- ),
114
- "single_muon": (
115
- Stage(
116
- name="Pythia Generation",
117
- stage="pythia_generation",
118
- script="simulation/pythia_gen.py",
119
- config="pythia_config.yaml",
120
- ),
121
- Stage(
122
- name="Detector Simulation",
123
- stage="simulation",
124
- script="simulation/ddsim_run.py",
125
- config="simulation_config.yaml",
126
- ),
127
- Stage(
128
- name="Digitization & Reconstruction",
129
- stage="digitization",
130
- script="simulation/digi_and_reco.py",
131
- config="digitization_config.yaml",
132
- ),
133
- Stage(
134
- name="Parquet Conversion",
135
- stage="convert_all",
136
- script="postprocessing/convert_all.py",
137
- config="convert_all.yaml",
138
- ),
139
108
  ),
109
+ # NOTE: `single_muon` is intentionally absent. Its preset was removed and it
110
+ # was mis-routed through Pythia generation (it needs an ACTS particle-gun
111
+ # stage, not a hard-process generator). Re-add it only with a correct
112
+ # particle-gun pipeline.
140
113
  }
141
114
 
142
115
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: colliderml
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A modern machine learning library for high-energy physics data analysis
5
5
  Home-page: https://github.com/OpenDataDetector/ColliderML
6
6
  Author: Daniel Murnane
@@ -62,61 +62,6 @@ colliderml/tasks/tracking/baselines/oracle.py
62
62
  colliderml/utils/__init__.py
63
63
  colliderml/viz/__init__.py
64
64
  colliderml/viz/plotting_utils.py
65
- docs/acat.md
66
- docs/ais25.md
67
- docs/appendices.md
68
- docs/changelog.md
69
- docs/ctd25.md
70
- docs/index.md
71
- docs/package-lock.json
72
- docs/package.json
73
- docs/tsconfig.json
74
- docs/.vitepress/config.ts
75
- docs/.vitepress/shims-vue.d.ts
76
- docs/.vitepress/cache/deps/_metadata.json
77
- docs/.vitepress/cache/deps/chunk-VJWGEPT5.js
78
- docs/.vitepress/cache/deps/chunk-VJWGEPT5.js.map
79
- docs/.vitepress/cache/deps/package.json
80
- docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js
81
- docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map
82
- docs/.vitepress/cache/deps/vitepress___@vueuse_core.js
83
- docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map
84
- docs/.vitepress/cache/deps/vue.js
85
- docs/.vitepress/cache/deps/vue.js.map
86
- docs/.vitepress/components/AboutData.vue
87
- docs/.vitepress/components/DataConfig.vue
88
- docs/.vitepress/theme/custom.css
89
- docs/.vitepress/theme/index.ts
90
- docs/guide/installation.md
91
- docs/guide/introduction.md
92
- docs/guide/quickstart.md
93
- docs/guide/remote-simulation.md
94
- docs/guide/simulation.md
95
- docs/guide/tasks.md
96
- docs/guide/tutorial.md
97
- docs/internal/admin.md
98
- docs/internal/backend.md
99
- docs/internal/container-image.md
100
- docs/internal/deployment.md
101
- docs/internal/overview.md
102
- docs/internal/sfapi.md
103
- docs/library/benchmarks.md
104
- docs/library/cli.md
105
- docs/library/exploding.md
106
- docs/library/loading.md
107
- docs/library/overview.md
108
- docs/library/physics.md
109
- docs/library/remote.md
110
- docs/library/simulate.md
111
- docs/library/tasks.md
112
- docs/public/.nojekyll
113
- docs/public/logo.png
114
- docs/public/size-estimates.json
115
- docs/spaces/event-display.md
116
- docs/spaces/leaderboard.md
117
- docs/spaces/model-zoo.md
118
- docs/spaces/overview.md
119
- docs/spaces/simulation-form.md
120
65
  tests/__init__.py
121
66
  tests/test_calo_calibration.py
122
67
  tests/test_cli_download.py
@@ -139,4 +84,16 @@ tests/test_tasks_registry.py
139
84
  tests/test_tasks_tracking_baselines.py
140
85
  tests/test_tasks_tracking_env_override.py
141
86
  tests/test_tasks_tracking_explode.py
142
- tests/test_tasks_tracking_metrics.py
87
+ tests/test_tasks_tracking_metrics.py
88
+ tests/pipeline/__init__.py
89
+ tests/pipeline/_http.py
90
+ tests/pipeline/conftest.py
91
+ tests/pipeline/test_e2e_core_loop.py
92
+ tests/pipeline/test_stage_benchmark_tasks.py
93
+ tests/pipeline/test_stage_import.py
94
+ tests/pipeline/test_stage_leaderboard.py
95
+ tests/pipeline/test_stage_load.py
96
+ tests/pipeline/test_stage_simulate_local.py
97
+ tests/pipeline/test_stage_simulate_remote.py
98
+ tests/pipeline/test_stage_tasks_evaluate.py
99
+ tests/pipeline/test_stage_tasks_submit.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="colliderml",
5
- version="0.4.1",
5
+ version="0.4.2",
6
6
  description="A modern machine learning library for high-energy physics data analysis",
7
7
  long_description=open("README.md", encoding="utf-8").read(),
8
8
  long_description_content_type="text/markdown",
File without changes
@@ -0,0 +1,59 @@
1
+ """Tiny stdlib HTTP helpers for the pipeline suite (no `requests` dependency)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ import time
8
+ import urllib.error
9
+ import urllib.request
10
+ from typing import Dict, Optional
11
+
12
+ LIVE_BACKEND_URL = os.environ.get(
13
+ "COLLIDERML_LIVE_BACKEND", "https://colliderml-backend.onrender.com"
14
+ ).rstrip("/")
15
+
16
+
17
+ def _maybe_json(body: str):
18
+ try:
19
+ return json.loads(body)
20
+ except (ValueError, TypeError):
21
+ return body
22
+
23
+
24
+ def http_get(url: str, *, timeout: float = 15.0, headers: Optional[Dict[str, str]] = None):
25
+ """GET a URL; return (status_code, parsed_json_or_text)."""
26
+ req = urllib.request.Request(url, headers=headers or {}, method="GET")
27
+ try:
28
+ with urllib.request.urlopen(req, timeout=timeout) as resp:
29
+ return resp.status, _maybe_json(resp.read().decode("utf-8", "replace"))
30
+ except urllib.error.HTTPError as e:
31
+ body = e.read().decode("utf-8", "replace") if e.fp else ""
32
+ return e.code, _maybe_json(body)
33
+
34
+
35
+ def http_post(url: str, *, json_body=None, timeout: float = 30.0, headers: Optional[Dict[str, str]] = None):
36
+ """POST JSON to a URL; return (status_code, parsed_json_or_text)."""
37
+ data = json.dumps(json_body or {}).encode("utf-8")
38
+ hdrs = {"Content-Type": "application/json", **(headers or {})}
39
+ req = urllib.request.Request(url, data=data, headers=hdrs, method="POST")
40
+ try:
41
+ with urllib.request.urlopen(req, timeout=timeout) as resp:
42
+ return resp.status, _maybe_json(resp.read().decode("utf-8", "replace"))
43
+ except urllib.error.HTTPError as e:
44
+ body = e.read().decode("utf-8", "replace") if e.fp else ""
45
+ return e.code, _maybe_json(body)
46
+
47
+
48
+ def wait_for_health(base_url: str, *, deadline_s: float = 90.0) -> bool:
49
+ """Poll ``{base_url}/healthz`` until 200 or the deadline (cold-start safe)."""
50
+ end = time.time() + deadline_s
51
+ while time.time() < end:
52
+ try:
53
+ status, _ = http_get(f"{base_url}/healthz", timeout=10.0)
54
+ if status == 200:
55
+ return True
56
+ except Exception:
57
+ pass
58
+ time.sleep(3.0)
59
+ return False
@@ -0,0 +1,163 @@
1
+ """Shared fixtures for the pipeline-health suite.
2
+
3
+ Reuses the existing mock harnesses (``_FakeRequests`` from
4
+ ``tests/test_remote_client.py``, the ``stub_loader`` pattern from
5
+ ``tests/test_load_unified.py``) and adds backend fixtures for the two
6
+ targeting modes:
7
+
8
+ * **hermetic** — a CI-stood-up backend at ``$COLLIDERML_BACKEND``
9
+ (docker-compose, mock-SFAPI). Tests skip cleanly if it isn't set.
10
+ * **live** — the deployed backend (``colliderml-backend.onrender.com``),
11
+ used by the drift-detector lane; warmed for Render free-tier cold start.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ import os
17
+ import shutil
18
+ import sys
19
+ from typing import Any, Dict, List, Optional
20
+
21
+ import pytest
22
+
23
+ from tests.pipeline._http import LIVE_BACKEND_URL, http_get, wait_for_health # noqa: F401
24
+
25
+
26
+ # ---------------------------------------------------------------------------
27
+ # Backend target fixtures
28
+ # ---------------------------------------------------------------------------
29
+
30
+ @pytest.fixture(scope="session")
31
+ def hermetic_backend() -> str:
32
+ """URL of a CI-stood-up backend; skip if not provided.
33
+
34
+ The pipeline-health workflow sets COLLIDERML_BACKEND=http://localhost:8000
35
+ after `docker compose up`. Locally: run backend/docker-compose.yml (or
36
+ scripts/setup_tutorial_env.sh) and export COLLIDERML_BACKEND.
37
+ """
38
+ url = os.environ.get("COLLIDERML_BACKEND", "").rstrip("/")
39
+ if not url or "onrender.com" in url:
40
+ pytest.skip("no hermetic backend ($COLLIDERML_BACKEND points at localhost compose)")
41
+ if not wait_for_health(url, deadline_s=60.0):
42
+ pytest.skip(f"hermetic backend {url} did not become healthy")
43
+ return url
44
+
45
+
46
+ @pytest.fixture(scope="session")
47
+ def live_backend() -> str:
48
+ """URL of the deployed backend, warmed for cold start."""
49
+ url = LIVE_BACKEND_URL.rstrip("/")
50
+ if not wait_for_health(url, deadline_s=90.0):
51
+ pytest.skip(f"live backend {url} unreachable / did not wake")
52
+ return url
53
+
54
+
55
+ @pytest.fixture
56
+ def hf_token() -> str:
57
+ """A real HF bearer token, or skip cleanly (for `needs_hf_token` tests)."""
58
+ tok = os.environ.get("HF_TOKEN") or os.environ.get("HUGGING_FACE_HUB_TOKEN")
59
+ if not tok:
60
+ pytest.skip("HF_TOKEN not set")
61
+ return tok
62
+
63
+
64
+ @pytest.fixture
65
+ def docker_available() -> str:
66
+ rt = shutil.which("docker") or shutil.which("podman")
67
+ if not rt:
68
+ pytest.skip("no docker/podman runtime on PATH")
69
+ return rt
70
+
71
+
72
+ @pytest.fixture(scope="session")
73
+ def admin_token() -> str:
74
+ return os.environ.get("ADMIN_TOKEN", "dev-admin-token")
75
+
76
+
77
+ # ---------------------------------------------------------------------------
78
+ # Reused mock harnesses
79
+ # ---------------------------------------------------------------------------
80
+ # Lifted from tests/test_remote_client.py so the pipeline suite is self-contained.
81
+
82
+ class _FakeResponse:
83
+ def __init__(self, status_code: int = 200, json_body: Optional[Dict[str, Any]] = None, text: str = "") -> None:
84
+ self.status_code = status_code
85
+ self._json_body = json_body if json_body is not None else {}
86
+ self.text = text or str(self._json_body)
87
+
88
+ def json(self) -> Dict[str, Any]:
89
+ return self._json_body
90
+
91
+ def raise_for_status(self) -> None:
92
+ if self.status_code >= 400:
93
+ raise _FakeHTTPError(f"status {self.status_code}")
94
+
95
+
96
+ class _FakeHTTPError(Exception):
97
+ pass
98
+
99
+
100
+ class _FakeRequestException(Exception):
101
+ pass
102
+
103
+
104
+ class _FakeRequests:
105
+ """Minimal stand-in for the `requests` module."""
106
+
107
+ RequestException = _FakeRequestException
108
+
109
+ def __init__(self) -> None:
110
+ self.post_calls: List[Dict[str, Any]] = []
111
+ self.get_calls: List[Dict[str, Any]] = []
112
+ self.post_response: _FakeResponse = _FakeResponse(200, {"request_id": "stub"})
113
+ self.get_response: _FakeResponse = _FakeResponse(200, {})
114
+ self.raise_on_post: Optional[Exception] = None
115
+
116
+ def post(self, url, *, json=None, data=None, files=None, headers=None, timeout=None):
117
+ if self.raise_on_post is not None:
118
+ raise self.raise_on_post
119
+ self.post_calls.append(
120
+ {"url": url, "json": json, "data": data, "files": files, "headers": headers, "timeout": timeout}
121
+ )
122
+ return self.post_response
123
+
124
+ def get(self, url, *, headers=None, timeout=None):
125
+ self.get_calls.append({"url": url, "headers": headers, "timeout": timeout})
126
+ return self.get_response
127
+
128
+
129
+ @pytest.fixture
130
+ def fake_requests(monkeypatch: pytest.MonkeyPatch) -> _FakeRequests:
131
+ """Install a fake `requests` module + stub HF auth; return the fake."""
132
+ from colliderml.remote import _auth as auth_mod
133
+ from colliderml.remote import _client as client_mod
134
+
135
+ fake = _FakeRequests()
136
+ monkeypatch.setitem(sys.modules, "requests", fake) # type: ignore[arg-type]
137
+ monkeypatch.setattr(auth_mod, "require_hf_token", lambda: "test-token")
138
+ monkeypatch.setattr(client_mod, "require_hf_token", lambda: "test-token")
139
+ return fake
140
+
141
+
142
+ @pytest.fixture
143
+ def stub_loader(monkeypatch: pytest.MonkeyPatch):
144
+ """Replace the core loader + cache-ensurance so load tests are pure-Python."""
145
+ import polars as pl
146
+
147
+ from colliderml import _load as load_mod
148
+
149
+ calls: Dict[str, object] = {}
150
+
151
+ def fake_ensure(channel, pileup, tables, *, dataset_id, revision=None, max_events=None, event_range=None):
152
+ calls["ensure"] = (channel, pileup, list(tables), dataset_id, revision)
153
+ calls["ensure_bounds"] = (max_events, event_range)
154
+
155
+ stub_frame = pl.DataFrame({"event_id": list(range(10)), "hit_id": list(range(10))})
156
+
157
+ def fake_load_tables(cfg):
158
+ calls["cfg"] = cfg
159
+ return {"tracker_hits": stub_frame.clone(), "particles": stub_frame.clone()}
160
+
161
+ monkeypatch.setattr(load_mod, "_ensure_local", fake_ensure)
162
+ monkeypatch.setattr(load_mod, "_core_load_tables", fake_load_tables)
163
+ return calls
@@ -0,0 +1,72 @@
1
+ """End-to-end: the whole core loop against the CI compose backend (mock-SFAPI).
2
+
3
+ load -> remote.submit -> wait_for(completed) -> balance dropped -> tasks.evaluate
4
+ -> tasks.submit -> leaderboard read reflects the submission. Green once the
5
+ backend test-auth seam (ALLOW_TEST_TOKEN) lands; skips cleanly without a token
6
+ or a hermetic backend.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import pyarrow as pa
12
+ import pytest
13
+
14
+ import colliderml
15
+ from tests.pipeline._http import http_get, http_post
16
+
17
+ pytestmark = [pytest.mark.pipeline, pytest.mark.e2e, pytest.mark.hermetic]
18
+
19
+
20
+ def _jets_table(n: int = 12) -> pa.Table:
21
+ prob_b = [0.05 + 0.9 * (i / (n - 1)) for i in range(n)]
22
+ prob_c = [(1.0 - p) * 0.4 for p in prob_b]
23
+ prob_light = [1.0 - b - c for b, c in zip(prob_b, prob_c)]
24
+ return pa.table({
25
+ "event_id": list(range(n)), "jet_id": list(range(n)),
26
+ "prob_b": prob_b, "prob_c": prob_c, "prob_light": prob_light,
27
+ })
28
+
29
+
30
+ def test_core_loop_end_to_end(hermetic_backend, hf_token, admin_token, monkeypatch):
31
+ monkeypatch.setenv("HF_TOKEN", hf_token)
32
+
33
+ # --- learn + fund the CI test user (created on first /v1/me hit) ---
34
+ bearer = {"Authorization": f"Bearer {hf_token}"}
35
+ st, me = http_get(f"{hermetic_backend}/v1/me", headers=bearer, timeout=20)
36
+ assert st == 200, f"/v1/me -> {st}: {me}"
37
+ username = me["hf_username"]
38
+ st, _ = http_post(
39
+ f"{hermetic_backend}/admin/grant",
40
+ json_body={"hf_username": username, "delta": 1000, "reason": "ci-e2e"},
41
+ headers={"X-Admin-Token": admin_token}, timeout=20,
42
+ )
43
+ assert st == 200, f"/admin/grant -> {st}"
44
+
45
+ # --- 1. load public mini-data ---
46
+ frames = colliderml.load("ttbar_pu0", tables=["particles"], max_events=2)
47
+ assert frames["particles"].height >= 1
48
+
49
+ # --- 2-4. remote submit -> poll -> balance dropped ---
50
+ from colliderml.remote import balance, submit, wait_for
51
+
52
+ before = balance(backend_url=hermetic_backend)
53
+ sub = submit(channel="higgs_portal", events=10, pileup=0, seed=11, backend_url=hermetic_backend)
54
+ assert sub.request_id
55
+ final = wait_for(sub.request_id, backend_url=hermetic_backend, timeout=60, poll_interval=1.0)
56
+ assert final.state == "completed"
57
+ assert balance(backend_url=hermetic_backend) <= before
58
+
59
+ # --- 5. tasks evaluate (local preview) ---
60
+ table = _jets_table()
61
+ assert "btag_auc" in colliderml.tasks.evaluate("jets", table)
62
+
63
+ # --- 6. tasks submit ---
64
+ body = colliderml.tasks.submit("jets", table, backend_url=hermetic_backend)
65
+ assert "submission_id" in body
66
+
67
+ # --- 7. leaderboard reflects the submission ---
68
+ st, lb = http_get(f"{hermetic_backend}/v1/leaderboard/jets", timeout=20)
69
+ assert st == 200 and isinstance(lb, list)
70
+ assert body["submission_id"] in {r.get("id") for r in lb} or any(
71
+ r.get("hf_username") == username for r in lb
72
+ )
@@ -0,0 +1,39 @@
1
+ """Pipeline stage: benchmark-tasks / model-zoo surface.
2
+
3
+ Asserts the backend task catalogue is well-formed and that the client's
4
+ registered task metadata matches the backend's — catching client/server
5
+ registry skew (the backend scores against the library's task definitions).
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import pytest
11
+
12
+ import colliderml
13
+ from tests.pipeline._http import http_get
14
+
15
+ pytestmark = pytest.mark.pipeline
16
+
17
+
18
+ @pytest.mark.live
19
+ def test_benchmark_tasks_well_formed(live_backend):
20
+ status, body = http_get(f"{live_backend}/v1/benchmark/tasks", timeout=30)
21
+ assert status == 200, f"HTTP {status} — {body}"
22
+ assert isinstance(body, list) and body
23
+ for t in body:
24
+ assert {"name", "metrics", "higher_is_better", "eval_event_range"}.issubset(t)
25
+ assert len(t["eval_event_range"]) == 2
26
+
27
+
28
+ @pytest.mark.hermetic
29
+ def test_client_metadata_matches_backend(hermetic_backend):
30
+ """The backend's per-task metrics/higher_is_better match the client registry."""
31
+ status, body = http_get(f"{hermetic_backend}/v1/benchmark/tasks", timeout=20)
32
+ assert status == 200, f"HTTP {status} — {body}"
33
+ for t in body:
34
+ name = t["name"]
35
+ client = colliderml.tasks.get(name)
36
+ assert list(t["metrics"]) == list(client.metrics), f"{name}: metrics differ"
37
+ assert dict(t["higher_is_better"]) == dict(client.higher_is_better), (
38
+ f"{name}: higher_is_better differs between server and client"
39
+ )