legend-simflow 1.0.0__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 (149) hide show
  1. legend_simflow-1.0.0/.JuliaFormatter.toml +45 -0
  2. legend_simflow-1.0.0/.gitattributes +2 -0
  3. legend_simflow-1.0.0/.github/dependabot.yml +7 -0
  4. legend_simflow-1.0.0/.github/logo.jpg +0 -0
  5. legend_simflow-1.0.0/.github/release.yml +5 -0
  6. legend_simflow-1.0.0/.github/workflows/add-to-remage-project.yaml +15 -0
  7. legend_simflow-1.0.0/.github/workflows/distribution.yml +48 -0
  8. legend_simflow-1.0.0/.github/workflows/main.yml +108 -0
  9. legend_simflow-1.0.0/.gitignore +183 -0
  10. legend_simflow-1.0.0/.pre-commit-config.yaml +102 -0
  11. legend_simflow-1.0.0/.readthedocs.yaml +23 -0
  12. legend_simflow-1.0.0/AGENTS.md +93 -0
  13. legend_simflow-1.0.0/CLAUDE.md +93 -0
  14. legend_simflow-1.0.0/LICENSE +674 -0
  15. legend_simflow-1.0.0/PKG-INFO +78 -0
  16. legend_simflow-1.0.0/README.md +18 -0
  17. legend_simflow-1.0.0/codecov.yml +22 -0
  18. legend_simflow-1.0.0/docs/AGENTS.md +35 -0
  19. legend_simflow-1.0.0/docs/Makefile +29 -0
  20. legend_simflow-1.0.0/docs/source/conf.py +124 -0
  21. legend_simflow-1.0.0/docs/source/img/rulegraph.mmd +86 -0
  22. legend_simflow-1.0.0/docs/source/index.md +124 -0
  23. legend_simflow-1.0.0/docs/source/manual/index.md +11 -0
  24. legend_simflow-1.0.0/docs/source/manual/meta.md +338 -0
  25. legend_simflow-1.0.0/docs/source/manual/prod.md +148 -0
  26. legend_simflow-1.0.0/docs/source/manual/setup.md +141 -0
  27. legend_simflow-1.0.0/docs/source/manual/sites.md +161 -0
  28. legend_simflow-1.0.0/docs/source/manual/tips.md +54 -0
  29. legend_simflow-1.0.0/docs/tools/generate_rule_docs.py +285 -0
  30. legend_simflow-1.0.0/pyproject.toml +231 -0
  31. legend_simflow-1.0.0/setup.cfg +4 -0
  32. legend_simflow-1.0.0/templates/default.yaml +78 -0
  33. legend_simflow-1.0.0/tests/AGENTS.md +10 -0
  34. legend_simflow-1.0.0/tests/conftest.py +102 -0
  35. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/README.md +1 -0
  36. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/crystals/B99000.yaml +27 -0
  37. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/crystals/README.md +1 -0
  38. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/crystals/V99000.yaml +29 -0
  39. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/diodes/B99000A.yaml +70 -0
  40. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/diodes/C99000A.yaml +76 -0
  41. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/diodes/P99000A.yaml +65 -0
  42. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/diodes/README.md +1 -0
  43. legend_simflow-1.0.0/tests/dummyprod/inputs/hardware/detectors/germanium/diodes/V99000A.yaml +76 -0
  44. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/geom/l200p02-geom-config.yaml +1 -0
  45. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/pars/geds/opv/l200-p02-r%-T%-all-opvs.yaml +2 -0
  46. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/pars/geds/opv/validity.yaml +3 -0
  47. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/pars/geds/ssd/adl-2016-temp-model.yaml +41 -0
  48. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/hit/l200p02/simconfig.yaml +7 -0
  49. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/stp/l200p02/confinement.yaml +50 -0
  50. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/stp/l200p02/generators.yaml +32 -0
  51. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/stp/l200p02/simconfig.yaml +88 -0
  52. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/stp/l200p02/template-cal.mac +16 -0
  53. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/stp/l200p02/template.mac +20 -0
  54. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/config/tier/vtx/l200p02/simconfig.yaml +15 -0
  55. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/l200a-optical-map-fiber.lh5 +0 -0
  56. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/l200a-optical-map-lar.lh5 +0 -0
  57. legend_simflow-1.0.0/tests/dummyprod/inputs/simprod/l200a-optical-map-pen.lh5 +0 -0
  58. legend_simflow-1.0.0/tests/dummyprod/simflow-config.yaml +37 -0
  59. legend_simflow-1.0.0/tests/l200data/v2.1.0/config.json +64 -0
  60. legend_simflow-1.0.0/tests/l200data/v2.1.0/generated/par/pht/cal/p03/r000/l200-p03-r000-cal-20230311T235840Z-par_pht.json +166 -0
  61. legend_simflow-1.0.0/tests/l200data/v2.1.0/generated/par/pht/validity.jsonl +76 -0
  62. legend_simflow-1.0.0/tests/l200data/v2.1.5/config.json +68 -0
  63. legend_simflow-1.0.0/tests/l200data/v3.0.0/dataflow-config.yaml +101 -0
  64. legend_simflow-1.0.0/tests/l200data/v3.0.0/generated/par/hit/cal/p16/r007/l200-p16-r007-cal-20251005T220109Z-par_hit.yaml +184 -0
  65. legend_simflow-1.0.0/tests/l200data/v3.0.0/generated/par/hit/validity.yaml +291 -0
  66. legend_simflow-1.0.0/tests/test_aggregate.py +194 -0
  67. legend_simflow-1.0.0/tests/test_awkward.py +50 -0
  68. legend_simflow-1.0.0/tests/test_commands.py +201 -0
  69. legend_simflow-1.0.0/tests/test_confine.py +62 -0
  70. legend_simflow-1.0.0/tests/test_hpge_pars.py +437 -0
  71. legend_simflow-1.0.0/tests/test_metadata.py +107 -0
  72. legend_simflow-1.0.0/tests/test_nersc.py +55 -0
  73. legend_simflow-1.0.0/tests/test_partitioning.py +26 -0
  74. legend_simflow-1.0.0/tests/test_patterns.py +317 -0
  75. legend_simflow-1.0.0/tests/test_profile.py +25 -0
  76. legend_simflow-1.0.0/tests/test_psl.py +307 -0
  77. legend_simflow-1.0.0/tests/test_reboost.py +593 -0
  78. legend_simflow-1.0.0/tests/test_spms_pars.py +125 -0
  79. legend_simflow-1.0.0/tests/test_tcm.py +156 -0
  80. legend_simflow-1.0.0/tests/test_utils.py +418 -0
  81. legend_simflow-1.0.0/tests/test_workflow.py +25 -0
  82. legend_simflow-1.0.0/tools/make-release +14 -0
  83. legend_simflow-1.0.0/workflow/AGENTS.md +42 -0
  84. legend_simflow-1.0.0/workflow/Snakefile +117 -0
  85. legend_simflow-1.0.0/workflow/profiles/default/config.yaml +4 -0
  86. legend_simflow-1.0.0/workflow/profiles/nersc-compute/config.yaml +19 -0
  87. legend_simflow-1.0.0/workflow/profiles/nersc-compute-slurm/config.yaml +109 -0
  88. legend_simflow-1.0.0/workflow/profiles/nersc-login/config.yaml +13 -0
  89. legend_simflow-1.0.0/workflow/rules/aux.smk +105 -0
  90. legend_simflow-1.0.0/workflow/rules/cvt.smk +50 -0
  91. legend_simflow-1.0.0/workflow/rules/evt.smk +36 -0
  92. legend_simflow-1.0.0/workflow/rules/hit.smk +82 -0
  93. legend_simflow-1.0.0/workflow/rules/opt.smk +86 -0
  94. legend_simflow-1.0.0/workflow/rules/par.smk +335 -0
  95. legend_simflow-1.0.0/workflow/rules/pdf.smk +67 -0
  96. legend_simflow-1.0.0/workflow/rules/stp.smk +186 -0
  97. legend_simflow-1.0.0/workflow/rules/vtx.smk +43 -0
  98. legend_simflow-1.0.0/workflow/src/LegendSimflow.jl/Project.toml +27 -0
  99. legend_simflow-1.0.0/workflow/src/LegendSimflow.jl/src/LegendSimflow.jl +15 -0
  100. legend_simflow-1.0.0/workflow/src/LegendSimflow.jl/src/pulse_shape_sim_helpers.jl +594 -0
  101. legend_simflow-1.0.0/workflow/src/LegendSimflow.jl/test/runtests.jl +6 -0
  102. legend_simflow-1.0.0/workflow/src/LegendSimflow.jl/test/test_lib.jl +159 -0
  103. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/PKG-INFO +78 -0
  104. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/SOURCES.txt +148 -0
  105. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/dependency_links.txt +1 -0
  106. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/entry_points.txt +3 -0
  107. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/not-zip-safe +1 -0
  108. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/requires.txt +43 -0
  109. legend_simflow-1.0.0/workflow/src/legend_simflow.egg-info/top_level.txt +1 -0
  110. legend_simflow-1.0.0/workflow/src/legendsimflow/__init__.py +24 -0
  111. legend_simflow-1.0.0/workflow/src/legendsimflow/_version.py +34 -0
  112. legend_simflow-1.0.0/workflow/src/legendsimflow/aggregate.py +506 -0
  113. legend_simflow-1.0.0/workflow/src/legendsimflow/awkward.py +53 -0
  114. legend_simflow-1.0.0/workflow/src/legendsimflow/cli.py +248 -0
  115. legend_simflow-1.0.0/workflow/src/legendsimflow/commands.py +473 -0
  116. legend_simflow-1.0.0/workflow/src/legendsimflow/confine.py +141 -0
  117. legend_simflow-1.0.0/workflow/src/legendsimflow/exceptions.py +23 -0
  118. legend_simflow-1.0.0/workflow/src/legendsimflow/hpge_pars.py +1133 -0
  119. legend_simflow-1.0.0/workflow/src/legendsimflow/matplotlibrc +8 -0
  120. legend_simflow-1.0.0/workflow/src/legendsimflow/metadata.py +429 -0
  121. legend_simflow-1.0.0/workflow/src/legendsimflow/nersc.py +152 -0
  122. legend_simflow-1.0.0/workflow/src/legendsimflow/partitioning.py +111 -0
  123. legend_simflow-1.0.0/workflow/src/legendsimflow/patterns.py +405 -0
  124. legend_simflow-1.0.0/workflow/src/legendsimflow/plot.py +103 -0
  125. legend_simflow-1.0.0/workflow/src/legendsimflow/profile.py +144 -0
  126. legend_simflow-1.0.0/workflow/src/legendsimflow/psl.py +402 -0
  127. legend_simflow-1.0.0/workflow/src/legendsimflow/reboost.py +599 -0
  128. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/__init__.py +14 -0
  129. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/crawl_legend_slow_control.py +120 -0
  130. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/extract_hpge_current_pulse_model.py +152 -0
  131. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/init-julia-env.jl +24 -0
  132. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/make_hpge_drift_time_maps.jl +104 -0
  133. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/make_hpge_ideal_pulse_shape_lib.jl +103 -0
  134. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/make_hpge_realistic_pulse_shape_lib.py +94 -0
  135. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/make_simstat_partition_file.py +70 -0
  136. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/plots/hpge_drift_time_maps.py +134 -0
  137. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/plots/tier_cvt_observables.py +162 -0
  138. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/plots/tier_hit_observables.py +193 -0
  139. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/plots/tier_opt_observables.py +152 -0
  140. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/plots/tier_stp_vertices.py +91 -0
  141. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/print_benchmark_stats.py +127 -0
  142. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/print_simflow_stats.py +64 -0
  143. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/tier/cvt.py +48 -0
  144. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/tier/evt.py +281 -0
  145. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/tier/hit.py +417 -0
  146. legend_simflow-1.0.0/workflow/src/legendsimflow/scripts/tier/opt.py +321 -0
  147. legend_simflow-1.0.0/workflow/src/legendsimflow/spms_pars.py +391 -0
  148. legend_simflow-1.0.0/workflow/src/legendsimflow/tcm.py +208 -0
  149. legend_simflow-1.0.0/workflow/src/legendsimflow/utils.py +469 -0
@@ -0,0 +1,45 @@
1
+ style = "default"
2
+
3
+ indent = 4
4
+ margin = 120
5
+
6
+ always_for_in = true
7
+
8
+ short_to_long_function_def = true
9
+ long_to_short_function_def = false
10
+ force_long_function_def = false
11
+ always_use_return = true
12
+
13
+ remove_extra_newlines = false
14
+
15
+ align_assignment = true
16
+ align_struct_field = true
17
+ align_pair_arrow = true
18
+ align_conditional = true
19
+
20
+ disallow_single_arg_nesting = false
21
+
22
+ trailing_comma = false
23
+ trailing_zero = true
24
+
25
+ whitespace_in_kwargs = true #
26
+ whitespace_typedefs = false
27
+ whitespace_ops_in_indices = true #
28
+ separate_kwargs_with_semicolon = false
29
+ surround_whereop_typeparameters = false
30
+
31
+ import_to_using = false
32
+ pipe_to_function_call = false
33
+
34
+ format_docstrings = false
35
+
36
+ join_lines_based_on_source = true
37
+
38
+ indent_submodule = false
39
+ short_circuit_to_if = false
40
+
41
+ format_markdown = false
42
+
43
+ normalize_line_endings = "unix"
44
+
45
+ ignore = []
@@ -0,0 +1,2 @@
1
+ # SCM syntax highlighting & preventing 3-way merges
2
+ pixi.lock merge=binary linguist-language=YAML linguist-generated=true
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "monthly"
Binary file
@@ -0,0 +1,5 @@
1
+ changelog:
2
+ exclude:
3
+ authors:
4
+ - dependabot[bot]
5
+ - pre-commit-ci[bot]
@@ -0,0 +1,15 @@
1
+ name: Add new issues to remage project
2
+
3
+ on:
4
+ issues:
5
+ types:
6
+ - opened
7
+
8
+ jobs:
9
+ add:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/add-to-project@v1.0.2
13
+ with:
14
+ project-url: https://github.com/orgs/legend-exp/projects/31 # remage
15
+ github-token: ${{ secrets.ADD_TO_REMAGE_PROJECT }}
@@ -0,0 +1,48 @@
1
+ name: distribute
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ env:
18
+ FORCE_COLOR: 3
19
+
20
+ jobs:
21
+ dist:
22
+ name: Distribution build
23
+ runs-on: ubuntu-latest
24
+
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+ with:
28
+ fetch-depth: 0
29
+
30
+ - uses: hynek/build-and-inspect-python-package@v2
31
+
32
+ publish:
33
+ needs: [dist]
34
+ name: Publish to PyPI
35
+ environment: pypi
36
+ permissions:
37
+ id-token: write
38
+ runs-on: ubuntu-latest
39
+ if: github.event_name == 'release' && github.event.action == 'published'
40
+
41
+ steps:
42
+ - uses: actions/download-artifact@v7
43
+ with:
44
+ name: Packages
45
+ path: dist
46
+
47
+ - uses: pypa/gh-action-pypi-publish@release/v1
48
+ if: github.event_name == 'release' && github.event.action == 'published'
@@ -0,0 +1,108 @@
1
+ name: legend-simflow
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ - "releases/**"
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ env:
16
+ FORCE_COLOR: 3
17
+
18
+ jobs:
19
+ pre-commit:
20
+ name: Format
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+ with:
25
+ fetch-depth: 0
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: "3.x"
29
+ - name: Set up Julia
30
+ uses: julia-actions/setup-julia@v2
31
+ with:
32
+ version: "1.10"
33
+ - name: Set up JuliaFormatter
34
+ run: julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
35
+ - uses: pre-commit/action@v3.0.1
36
+ with:
37
+ extra_args: --all-files --show-diff-on-failure
38
+
39
+ unit-tests:
40
+ name: Run legend-simflow unit tests
41
+ runs-on: ${{ matrix.os }}
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ python-version: ["3.12", "3.13"]
46
+ os: [ubuntu-latest, macos-latest]
47
+
48
+ steps:
49
+ - uses: actions/checkout@v6
50
+ - name: Set up Python ${{ matrix.python-version }}
51
+ uses: actions/setup-python@v6
52
+ with:
53
+ python-version: ${{ matrix.python-version }}
54
+ - name: Install non-python (homebrew) dependencies
55
+ if: ${{ matrix.os == 'macOS-latest' }}
56
+ run: |
57
+ brew update
58
+ brew install opencascade cgal gmp mpfr boost
59
+ - name: Get dependencies and install legend-simflow
60
+ run: |
61
+ python -m pip install --upgrade pip wheel setuptools
62
+ python -m pip install --upgrade .[test]
63
+ - name: Run unit tests
64
+ run: |
65
+ python -m pytest
66
+
67
+ test-coverage:
68
+ name: Calculate and upload test coverage
69
+ runs-on: ubuntu-latest
70
+ steps:
71
+ - uses: actions/checkout@v6
72
+ with:
73
+ fetch-depth: 2
74
+ - uses: actions/setup-python@v6
75
+ with:
76
+ python-version: "3.12"
77
+
78
+ - name: Generate Report
79
+ run: |
80
+ python -m pip install --upgrade pip wheel setuptools
81
+ python -m pip install --upgrade .[test]
82
+ python -m pytest --cov=legendsimflow --cov-report=xml
83
+ - name: Upload Coverage to codecov.io
84
+ uses: codecov/codecov-action@v5
85
+ with:
86
+ token: ${{ secrets.CODECOV_TOKEN }}
87
+ test_julia:
88
+ name: Run Julia tests
89
+ runs-on: ubuntu-latest
90
+ steps:
91
+ - uses: actions/checkout@v6
92
+ with:
93
+ fetch-depth: 0
94
+ - uses: prefix-dev/setup-pixi@v0
95
+ - name: Run Julia tests with coverage
96
+ run: |
97
+ pixi run julia workflow/src/legendsimflow/scripts/init-julia-env.jl
98
+ pixi run julia --code-coverage=user --project=workflow/src/LegendSimflow.jl -e 'using Pkg; Pkg.test(coverage=true)'
99
+ - name: Process Julia coverage
100
+ uses: julia-actions/julia-processcoverage@v1
101
+ with:
102
+ directories: workflow/src/LegendSimflow.jl/src
103
+ - name: Upload Julia coverage
104
+ uses: codecov/codecov-action@v5
105
+ with:
106
+ token: ${{ secrets.CODECOV_TOKEN }}
107
+ files: lcov.info
108
+ flags: julia
@@ -0,0 +1,183 @@
1
+ *.swp
2
+ *.swo
3
+ workflow/src/legendsimflow/_version.py
4
+ .snakemake
5
+ /inputs
6
+ /simflow-config.yaml
7
+ /generated
8
+ tests/dummyprod/generated
9
+ tests/dummyprod/inputs/hardware/configuration
10
+ tests/dummyprod/inputs/datasets
11
+
12
+ # Byte-compiled / optimized / DLL files
13
+ __pycache__/
14
+ *.py[cod]
15
+ *$py.class
16
+
17
+ # C extensions
18
+ *.so
19
+
20
+ # Distribution / packaging
21
+ .Python
22
+ build/
23
+ develop-eggs/
24
+ dist/
25
+ downloads/
26
+ eggs/
27
+ .eggs/
28
+ lib/
29
+ lib64/
30
+ parts/
31
+ sdist/
32
+ var/
33
+ wheels/
34
+ share/python-wheels/
35
+ *.egg-info/
36
+ .installed.cfg
37
+ *.egg
38
+ MANIFEST
39
+ fontlist-*.json
40
+
41
+ # PyInstaller
42
+ # Usually these files are written by a python script from a template
43
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
44
+ *.manifest
45
+ *.spec
46
+
47
+ # Installer logs
48
+ pip-log.txt
49
+ pip-delete-this-directory.txt
50
+
51
+ # Unit test / coverage reports
52
+ htmlcov/
53
+ .tox/
54
+ .nox/
55
+ .coverage
56
+ .coverage.*
57
+ .cache
58
+ nosetests.xml
59
+ coverage.xml
60
+ *.cover
61
+ *.py,cover
62
+ .hypothesis/
63
+ .pytest_cache/
64
+ cover/
65
+
66
+ # Translations
67
+ *.mo
68
+ *.pot
69
+
70
+ # Django stuff:
71
+ *.log
72
+ local_settings.py
73
+ db.sqlite3
74
+ db.sqlite3-journal
75
+
76
+ # Flask stuff:
77
+ instance/
78
+ .webassets-cache
79
+
80
+ # Scrapy stuff:
81
+ .scrapy
82
+
83
+ # Sphinx documentation
84
+ /docs/build/
85
+ /docs/source/api
86
+
87
+ # PyBuilder
88
+ .pybuilder/
89
+ target/
90
+
91
+ # Jupyter Notebook
92
+ .ipynb_checkpoints
93
+
94
+ # IPython
95
+ profile_default/
96
+ ipython_config.py
97
+
98
+ # pyenv
99
+ # For a library or package, you might want to ignore these files since the code is
100
+ # intended to run in multiple environments; otherwise, check them in:
101
+ # .python-version
102
+
103
+ # pipenv
104
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
105
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
106
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
107
+ # install all needed dependencies.
108
+ #Pipfile.lock
109
+
110
+ # poetry
111
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
112
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
113
+ # commonly ignored for libraries.
114
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
115
+ #poetry.lock
116
+
117
+ # pdm
118
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
119
+ #pdm.lock
120
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
121
+ # in version control.
122
+ # https://pdm.fming.dev/#use-with-ide
123
+ .pdm.toml
124
+
125
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
126
+ __packages__/
127
+
128
+ # Celery stuff
129
+ celerybeat-schedule
130
+ celerybeat.pid
131
+
132
+ # SageMath parsed files
133
+ *.sage.py
134
+
135
+ # Environments
136
+ .env
137
+ .venv
138
+ env/
139
+ venv/
140
+ ENV/
141
+ env.bak/
142
+ venv.bak/
143
+
144
+ # Spyder project settings
145
+ .spyderproject
146
+ .spyproject
147
+
148
+ # Rope project settings
149
+ .ropeproject
150
+
151
+ # mkdocs documentation
152
+ /site
153
+
154
+ # mypy
155
+ .mypy_cache/
156
+ .dmypy.json
157
+ dmypy.json
158
+
159
+ # Pyre type checker
160
+ .pyre/
161
+
162
+ # pytype static type analyzer
163
+ .pytype/
164
+
165
+ # Cython debug symbols
166
+ cython_debug/
167
+
168
+ # PyCharm
169
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
170
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
171
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
172
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
173
+ #.idea/
174
+
175
+ # julia
176
+ Manifest.toml
177
+
178
+ # AI
179
+ .aider*
180
+ # pixi environments
181
+ .pixi/*
182
+ !.pixi/config.toml
183
+ pixi.lock
@@ -0,0 +1,102 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autoupdate_schedule: "quarterly"
4
+ autofix_commit_msg: "style: pre-commit fixes"
5
+
6
+ repos:
7
+ - repo: https://github.com/adamchainz/blacken-docs
8
+ rev: "1.20.0"
9
+ hooks:
10
+ - id: blacken-docs
11
+ additional_dependencies: [black==24.*]
12
+ exclude: ^README.md
13
+
14
+ - repo: https://github.com/pre-commit/pre-commit-hooks
15
+ rev: "v6.0.0"
16
+ hooks:
17
+ - id: check-added-large-files
18
+ - id: check-case-conflict
19
+ - id: check-merge-conflict
20
+ - id: check-symlinks
21
+ - id: check-yaml
22
+ - id: check-json
23
+ - id: check-toml
24
+ - id: check-docstring-first
25
+ - id: debug-statements
26
+ - id: end-of-file-fixer
27
+ - id: forbid-new-submodules
28
+ - id: mixed-line-ending
29
+ - id: name-tests-test
30
+ args: ["--pytest-test-first"]
31
+ - id: requirements-txt-fixer
32
+ - id: trailing-whitespace
33
+
34
+ - repo: https://github.com/astral-sh/ruff-pre-commit
35
+ rev: "v0.14.4"
36
+ hooks:
37
+ - id: ruff
38
+ args: ["--fix", "--show-fixes"]
39
+ - id: ruff-format
40
+
41
+ - repo: https://github.com/codespell-project/codespell
42
+ rev: "v2.4.1"
43
+ hooks:
44
+ - id: codespell
45
+ args: ["-L", "nd,unparseable,compiletime,livetime,livetimes,puls"]
46
+
47
+ - repo: https://github.com/shellcheck-py/shellcheck-py
48
+ rev: "v0.11.0.1"
49
+ hooks:
50
+ - id: shellcheck
51
+
52
+ - repo: https://github.com/pre-commit/pygrep-hooks
53
+ rev: "v1.10.0"
54
+ hooks:
55
+ - id: rst-backticks
56
+ - id: rst-directive-colons
57
+ - id: rst-inline-touching-normal
58
+
59
+ - repo: https://github.com/rbubley/mirrors-prettier
60
+ rev: "v3.6.2"
61
+ hooks:
62
+ - id: prettier
63
+ types_or: [yaml]
64
+ - id: prettier
65
+ types_or: [markdown, html, css, scss, javascript, json]
66
+ args: [--prose-wrap=always]
67
+
68
+ - repo: local
69
+ hooks:
70
+ - id: disallow-caps
71
+ name: Disallow improper capitalization
72
+ language: pygrep
73
+ entry: PyBind|Cmake|CCache|Github|PyTest
74
+ exclude: .pre-commit-config.yaml
75
+
76
+ - repo: https://github.com/abravalheri/validate-pyproject
77
+ rev: "v0.24.1"
78
+ hooks:
79
+ - id: validate-pyproject
80
+ additional_dependencies: ["validate-pyproject-schema-store[all]"]
81
+
82
+ - repo: https://github.com/python-jsonschema/check-jsonschema
83
+ rev: "0.35.0"
84
+ hooks:
85
+ - id: check-dependabot
86
+ - id: check-github-workflows
87
+ - id: check-readthedocs
88
+
89
+ - repo: https://github.com/snakemake/snakefmt
90
+ rev: v0.11.2
91
+ hooks:
92
+ - id: snakefmt
93
+
94
+ - repo: local
95
+ hooks:
96
+ - id: julia-format
97
+ name: JuliaFormatter
98
+ entry: julia --color=yes -e 'using JuliaFormatter; format(ARGS)'
99
+ language: system
100
+ files: '\.jl$'
101
+ exclude: '^\.pixi/'
102
+ pass_filenames: true
@@ -0,0 +1,23 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: "ubuntu-22.04"
5
+ tools:
6
+ python: "3.12"
7
+ commands:
8
+ - asdf plugin add uv
9
+ - asdf install uv latest
10
+ - asdf global uv latest
11
+ - uv venv
12
+ - uv pip install .[docs]
13
+ - rm -rf docs/source/api
14
+ - .venv/bin/python -m sphinx.ext.apidoc
15
+ --private
16
+ --module-first
17
+ --force
18
+ --output-dir docs/source/api
19
+ workflow/src
20
+ workflow/src/legendsimflow/scripts
21
+ - python docs/tools/generate_rule_docs.py
22
+ - .venv/bin/python -m sphinx -W --keep-going -T -b html -d docs/_build/doctrees -D
23
+ language=en docs/source $READTHEDOCS_OUTPUT/html
@@ -0,0 +1,93 @@
1
+ # AGENTS.md
2
+
3
+ ## Project Overview
4
+
5
+ This repository hosts the workflow to run the Monte Carlo simulation pipeline
6
+ for the LEGEND experiment (often called "the Simflow"). Snakemake is used to
7
+ orchestrate routines based on the remage simulation ecosystem.
8
+
9
+ You can learn about the project from the markdown documentation source in
10
+ `docs/source/`:
11
+
12
+ - `index.md`: overview, key concepts
13
+ - `manual/meta.md`: configuration metadata, file naming conventions,
14
+ partitioning
15
+ - `manual/setup.md`: install the software and main configuration file
16
+ - `manual/prod.md`: how to run the workflow
17
+ - `manual/sites.md`: computing site specific docs
18
+ - `manual/tips.md`: tips and tricks
19
+
20
+ ## Dependencies & Tooling
21
+
22
+ Python package. See `pyproject.toml` for dependencies and build config,
23
+ including Pixi configuration.
24
+
25
+ ## Common Commands
26
+
27
+ - Install (dev): `uv pip install -e ".[all]"` — run once after cloning or after
28
+ dependency changes
29
+ - Test: `pixi run test` — run all tests (Python + Julia) before committing;
30
+ Python only: `pixi run test-python`; Julia only: `pixi run test-julia`; single
31
+ Python test: `pytest tests/test_foo.py::test_bar`
32
+ - Lint/format: `pre-commit run --all-files` — run before committing; every
33
+ commit must pass
34
+ - Build docs: `cd docs && make` — verify after any documentation change
35
+
36
+ ## Architecture
37
+
38
+ To understand the workflow, start with `workflow/Snakefile`, then follow the
39
+ imported modules under `workflow/rules/`.
40
+
41
+ - `workflow`: project source code
42
+ - `src/legendsimflow`: Python package
43
+ - `patterns.py`: filesystem paths used in Snakemake rules
44
+ - `aggregate.py`: functions to build list of files for the Simflow
45
+ - `hpge_pars.py`/`spms_pars.py`: routines to compute the HPGe/SiPM
46
+ parameters to be used in the `hit` and `opt` tiers, based on information
47
+ from the LEGEND-200 data
48
+ - `scripts`: scripts directly used in Snakemake rules
49
+ - `tier/`: scripts used to build the various tiers
50
+ - `plots/`: scripts used to generate validation plots
51
+ - `init-julia-env.jl`: initializes the Julia environment at first run
52
+ - `src/LegendSimflow.jl`: Julia package used in the Simflow
53
+ - `Project.toml`: Julia package manifest
54
+ - `src/LegendSimflow.jl`: module entrypoint
55
+ - `test/`: Julia package tests
56
+ - `rules`: Snakemake modules imported by the main `Snakefile`. Rules belonging
57
+ to each tier are organized in separate modules. The `aux.smk` module is used
58
+ for other auxiliary rules.
59
+ - `profiles`: Snakemake workflow profiles with common Snakemake CLI options
60
+ - `Snakefile`: the main Snakefile
61
+ - `templates`: template Simflow configuration files that users copy and adapt
62
+ when setting up a new production
63
+
64
+ ## Testing
65
+
66
+ See [`tests/AGENTS.md`](tests/AGENTS.md).
67
+
68
+ ## Linting
69
+
70
+ - Formatting/linting is enforced by pre-commit, hooks are listed in
71
+ `.pre-commit-config.yaml`, while further configuration is in `pyproject.toml`
72
+
73
+ ## Documentation
74
+
75
+ See [`docs/AGENTS.md`](docs/AGENTS.md) for documentation conventions, docstring
76
+ style, and Snakemake rule docstring conventions.
77
+
78
+ ## Code Conventions
79
+
80
+ See [`workflow/AGENTS.md`](workflow/AGENTS.md).
81
+
82
+ ## Git Workflow
83
+
84
+ - Commit style: Conventional Commits (https://www.conventionalcommits.org)
85
+ - Every commit must pass linting and testing
86
+ - PRs require passing CI
87
+ - Make sure to include a concise description of the changes in a PR and link the
88
+ relevant related PRs or issues
89
+
90
+ ## Boundaries
91
+
92
+ - ALWAYS: make sure linting, testing and docs building succeed **before**
93
+ committing