gitronics 0.6.2__tar.gz → 0.6.4__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.
- gitronics-0.6.4/.github/workflows/ci.yml +136 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/.gitignore +3 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/Cargo.lock +130 -6
- {gitronics-0.6.2 → gitronics-0.6.4}/Cargo.toml +18 -3
- {gitronics-0.6.2 → gitronics-0.6.4}/PKG-INFO +1 -1
- gitronics-0.6.4/README.md +188 -0
- gitronics-0.6.4/docs/assets/anatomy-light.svg +56 -0
- gitronics-0.6.4/docs/assets/anatomy.svg +56 -0
- gitronics-0.6.4/docs/assets/flow-light.svg +61 -0
- gitronics-0.6.4/docs/assets/flow.svg +61 -0
- gitronics-0.6.4/docs/assets/flow_readme.svg +69 -0
- gitronics-0.6.4/docs/assets/hero.svg +116 -0
- gitronics-0.6.4/docs/assets/inheritance-light.svg +69 -0
- gitronics-0.6.4/docs/assets/inheritance.svg +69 -0
- gitronics-0.6.4/docs/assets/logo.svg +30 -0
- gitronics-0.6.4/docs/assets/mapping-light.svg +59 -0
- gitronics-0.6.4/docs/assets/mapping.svg +59 -0
- gitronics-0.6.4/docs/assets/stylesheets/extra.css +21 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/best_practices.md +1 -6
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/assessments.md +1 -1
- gitronics-0.6.4/docs/getting_started/building_a_model.md +95 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/concepts.md +6 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/configuration_file.md +22 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/file_types.md +3 -4
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/index.md +7 -1
- gitronics-0.6.4/docs/usage/build.md +140 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/assessment_specific/small_override.yaml +1 -1
- {gitronics-0.6.2 → gitronics-0.6.4}/mkdocs.yml +5 -2
- gitronics-0.6.4/python/tests/test_cli_works.py +44 -0
- gitronics-0.6.4/python/tests/test_migrate_model.py +49 -0
- gitronics-0.6.4/report/eslint.config.mjs +50 -0
- gitronics-0.6.4/report/report.css +1707 -0
- gitronics-0.6.4/report/report.html +18 -0
- gitronics-0.6.4/report/report.js +1952 -0
- gitronics-0.6.4/report/vendor/diff.js +33 -0
- gitronics-0.6.4/resources/filled_model.mcnp +30 -0
- gitronics-0.6.4/src/build_model.rs +563 -0
- gitronics-0.6.4/src/build_record.rs +326 -0
- gitronics-0.6.4/src/build_report.rs +917 -0
- gitronics-0.6.4/src/error.rs +178 -0
- gitronics-0.6.4/src/fs_utils.rs +140 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/src/lib.rs +8 -2
- gitronics-0.6.4/src/mcnp_io.rs +191 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/src/migrate_model.rs +49 -33
- gitronics-0.6.4/src/model_config.rs +458 -0
- gitronics-0.6.4/src/project_manager/load_metadata.rs +178 -0
- gitronics-0.6.4/src/project_manager/load_project_files.rs +146 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/src/project_manager.rs +68 -26
- gitronics-0.6.4/src/provenance.rs +364 -0
- gitronics-0.6.4/src/runtime.rs +64 -0
- gitronics-0.6.4/src/types.rs +171 -0
- gitronics-0.6.4/tests/common/mod.rs +169 -0
- gitronics-0.6.4/tests/golden/small_override.assembled.mcnp +257 -0
- gitronics-0.6.4/tests/golden/small_override.build_report.json +396 -0
- gitronics-0.6.4/tests/golden/valid_configuration.assembled.mcnp +266 -0
- gitronics-0.6.4/tests/golden/valid_configuration.build_report.json +426 -0
- gitronics-0.6.4/tests/test_determinism.rs +140 -0
- gitronics-0.6.4/tests/test_envelope_metadata.rs +122 -0
- gitronics-0.6.4/tests/test_envelope_validation.rs +176 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/tests/test_example_project.rs +95 -45
- gitronics-0.6.4/tests/test_golden_build.rs +93 -0
- gitronics-0.6.4/tests/test_log_warnings.rs +53 -0
- gitronics-0.6.4/tests/test_migrate_round_trip.rs +123 -0
- gitronics-0.6.2/.github/workflows/ci.yml +0 -109
- gitronics-0.6.2/README.md +0 -112
- gitronics-0.6.2/docs/assets/logo.png +0 -0
- gitronics-0.6.2/docs/getting_started/building_a_model.md +0 -73
- gitronics-0.6.2/docs/usage/build.md +0 -77
- gitronics-0.6.2/python/tests/test_cli_works.py +0 -17
- gitronics-0.6.2/src/build_model.rs +0 -397
- gitronics-0.6.2/src/build_report.rs +0 -721
- gitronics-0.6.2/src/model_config.rs +0 -212
- gitronics-0.6.2/src/project_manager/load_metadata.rs +0 -47
- gitronics-0.6.2/src/project_manager/load_model_config.rs +0 -185
- gitronics-0.6.2/src/project_manager/load_project_files.rs +0 -107
- gitronics-0.6.2/src/report.css +0 -473
- gitronics-0.6.2/src/types.rs +0 -207
- gitronics-0.6.2/src/utils.rs +0 -375
- {gitronics-0.6.2 → gitronics-0.6.4}/.github/workflows/docs.yml +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/.github/workflows/release.yml +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/.vscode/settings.json +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/LICENSE +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/examples.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/card_id_numbers.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/migrating.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/new_project.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started/project_structure.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/getting_started.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/hooks/version_from_git.py +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/installation.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/requirements.txt +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/docs/usage/migrate.md +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/assessment_specific/filler_model_3.mcnp +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/assessment_specific/filler_model_3.metadata +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/configurations/valid_configuration.yaml +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/output/.gitignore +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/data_cards/fine_mesh.tally +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/data_cards/materials.mat +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/data_cards/my_transform.transform +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/data_cards/volumetric_source.source +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/envelope_structure.mcnp +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/envelope_structure.metadata +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/filler_models/filler_model_1.mcnp +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/filler_models/filler_model_1.metadata +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/filler_models/filler_model_2.mcnp +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/example_project/reference_model/filler_models/filler_model_2.metadata +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/pyproject.toml +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/python/gitronics/__init__.py +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/python/gitronics/__main__.py +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/python/gitronics/gitronics.pyi +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/python/tests/test_build_model.py +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/resources/simple_model.mcnp +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/src/cli.rs +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/src/main.rs +0 -0
- {gitronics-0.6.2 → gitronics-0.6.4}/src/python.rs +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
rust:
|
|
14
|
+
name: Rust tests (${{ matrix.os }})
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install Rust stable
|
|
23
|
+
uses: dtolnay/rust-toolchain@stable
|
|
24
|
+
with:
|
|
25
|
+
components: clippy, rustfmt
|
|
26
|
+
|
|
27
|
+
- name: Set up Python (Required for PyO3 test linking)
|
|
28
|
+
id: setup-python
|
|
29
|
+
uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.11"
|
|
32
|
+
|
|
33
|
+
- name: Configure PyO3 Python path
|
|
34
|
+
shell: bash
|
|
35
|
+
run: |
|
|
36
|
+
echo "PYO3_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
|
|
37
|
+
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
38
|
+
PYLIB=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
|
|
39
|
+
PYVER=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LDVERSION'))")
|
|
40
|
+
echo "RUSTFLAGS=-L${PYLIB} -lpython${PYVER}" >> $GITHUB_ENV
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
- name: Cache cargo registry
|
|
44
|
+
uses: actions/cache@v4
|
|
45
|
+
with:
|
|
46
|
+
path: |
|
|
47
|
+
~/.cargo/registry
|
|
48
|
+
~/.cargo/git
|
|
49
|
+
target
|
|
50
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
51
|
+
|
|
52
|
+
- name: rustfmt
|
|
53
|
+
run: cargo fmt --all --check
|
|
54
|
+
|
|
55
|
+
- name: Test
|
|
56
|
+
run: cargo test --workspace --features pyo3/auto-initialize
|
|
57
|
+
|
|
58
|
+
- name: Clippy
|
|
59
|
+
run: cargo clippy --workspace -- -D warnings
|
|
60
|
+
|
|
61
|
+
ruff:
|
|
62
|
+
name: Python lint (ruff)
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
|
|
67
|
+
- uses: astral-sh/setup-uv@v5
|
|
68
|
+
|
|
69
|
+
# Pinned so a new ruff release can't fail CI unexpectedly; bump deliberately.
|
|
70
|
+
- name: ruff lint
|
|
71
|
+
run: uvx ruff@0.15.21 check python
|
|
72
|
+
|
|
73
|
+
- name: ruff format
|
|
74
|
+
run: uvx ruff@0.15.21 format --check python
|
|
75
|
+
|
|
76
|
+
python:
|
|
77
|
+
name: Python tests (${{ matrix.os }})
|
|
78
|
+
runs-on: ${{ matrix.os }}
|
|
79
|
+
strategy:
|
|
80
|
+
matrix:
|
|
81
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
82
|
+
steps:
|
|
83
|
+
- uses: actions/checkout@v4
|
|
84
|
+
|
|
85
|
+
- name: Install Rust stable
|
|
86
|
+
uses: dtolnay/rust-toolchain@stable
|
|
87
|
+
|
|
88
|
+
- name: Set up Python
|
|
89
|
+
uses: actions/setup-python@v5
|
|
90
|
+
with:
|
|
91
|
+
python-version: "3.11"
|
|
92
|
+
|
|
93
|
+
- name: Cache cargo registry
|
|
94
|
+
uses: actions/cache@v4
|
|
95
|
+
with:
|
|
96
|
+
path: |
|
|
97
|
+
~/.cargo/registry
|
|
98
|
+
~/.cargo/git
|
|
99
|
+
target
|
|
100
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
101
|
+
|
|
102
|
+
- name: Install maturin and pytest
|
|
103
|
+
run: pip install maturin pytest
|
|
104
|
+
|
|
105
|
+
- name: Build and install Python package (dev mode)
|
|
106
|
+
run: pip install -e .
|
|
107
|
+
|
|
108
|
+
- name: Run Python tests
|
|
109
|
+
run: pytest
|
|
110
|
+
|
|
111
|
+
report-viewer:
|
|
112
|
+
name: Report viewer (JS)
|
|
113
|
+
runs-on: ubuntu-latest
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v4
|
|
116
|
+
|
|
117
|
+
- uses: actions/setup-node@v4
|
|
118
|
+
with:
|
|
119
|
+
node-version: "22"
|
|
120
|
+
cache: npm
|
|
121
|
+
cache-dependency-path: report/package-lock.json
|
|
122
|
+
|
|
123
|
+
- name: Install test dependencies
|
|
124
|
+
working-directory: report
|
|
125
|
+
run: npm ci
|
|
126
|
+
|
|
127
|
+
# The viewer and vendored library are inlined by `include_str!` —
|
|
128
|
+
# there is no bundle step, so this job never runs cargo and cargo
|
|
129
|
+
# never runs node.
|
|
130
|
+
- name: Syntax check
|
|
131
|
+
working-directory: report
|
|
132
|
+
run: node --check report.js
|
|
133
|
+
|
|
134
|
+
- name: Render tests (jsdom)
|
|
135
|
+
working-directory: report
|
|
136
|
+
run: node --test 'test/*.test.mjs'
|
|
@@ -124,12 +124,30 @@ version = "2.11.1"
|
|
|
124
124
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
125
125
|
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
|
|
126
126
|
|
|
127
|
+
[[package]]
|
|
128
|
+
name = "block-buffer"
|
|
129
|
+
version = "0.10.4"
|
|
130
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
132
|
+
dependencies = [
|
|
133
|
+
"generic-array",
|
|
134
|
+
]
|
|
135
|
+
|
|
127
136
|
[[package]]
|
|
128
137
|
name = "bumpalo"
|
|
129
138
|
version = "3.20.2"
|
|
130
139
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
140
|
checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
|
|
132
141
|
|
|
142
|
+
[[package]]
|
|
143
|
+
name = "castaway"
|
|
144
|
+
version = "0.2.4"
|
|
145
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
146
|
+
checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a"
|
|
147
|
+
dependencies = [
|
|
148
|
+
"rustversion",
|
|
149
|
+
]
|
|
150
|
+
|
|
133
151
|
[[package]]
|
|
134
152
|
name = "cc"
|
|
135
153
|
version = "1.2.62"
|
|
@@ -207,12 +225,35 @@ version = "1.0.5"
|
|
|
207
225
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
208
226
|
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
209
227
|
|
|
228
|
+
[[package]]
|
|
229
|
+
name = "compact_str"
|
|
230
|
+
version = "0.9.1"
|
|
231
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
232
|
+
checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab"
|
|
233
|
+
dependencies = [
|
|
234
|
+
"castaway",
|
|
235
|
+
"cfg-if",
|
|
236
|
+
"itoa",
|
|
237
|
+
"rustversion",
|
|
238
|
+
"ryu",
|
|
239
|
+
"static_assertions",
|
|
240
|
+
]
|
|
241
|
+
|
|
210
242
|
[[package]]
|
|
211
243
|
name = "core-foundation-sys"
|
|
212
244
|
version = "0.8.7"
|
|
213
245
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
214
246
|
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
|
215
247
|
|
|
248
|
+
[[package]]
|
|
249
|
+
name = "cpufeatures"
|
|
250
|
+
version = "0.2.17"
|
|
251
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
252
|
+
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
253
|
+
dependencies = [
|
|
254
|
+
"libc",
|
|
255
|
+
]
|
|
256
|
+
|
|
216
257
|
[[package]]
|
|
217
258
|
name = "crossbeam-deque"
|
|
218
259
|
version = "0.8.6"
|
|
@@ -238,6 +279,26 @@ version = "0.8.21"
|
|
|
238
279
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
239
280
|
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
240
281
|
|
|
282
|
+
[[package]]
|
|
283
|
+
name = "crypto-common"
|
|
284
|
+
version = "0.1.7"
|
|
285
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
286
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
287
|
+
dependencies = [
|
|
288
|
+
"generic-array",
|
|
289
|
+
"typenum",
|
|
290
|
+
]
|
|
291
|
+
|
|
292
|
+
[[package]]
|
|
293
|
+
name = "digest"
|
|
294
|
+
version = "0.10.7"
|
|
295
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
296
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
297
|
+
dependencies = [
|
|
298
|
+
"block-buffer",
|
|
299
|
+
"crypto-common",
|
|
300
|
+
]
|
|
301
|
+
|
|
241
302
|
[[package]]
|
|
242
303
|
name = "dunce"
|
|
243
304
|
version = "1.0.5"
|
|
@@ -349,6 +410,16 @@ dependencies = [
|
|
|
349
410
|
"slab",
|
|
350
411
|
]
|
|
351
412
|
|
|
413
|
+
[[package]]
|
|
414
|
+
name = "generic-array"
|
|
415
|
+
version = "0.14.7"
|
|
416
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
417
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
418
|
+
dependencies = [
|
|
419
|
+
"typenum",
|
|
420
|
+
"version_check",
|
|
421
|
+
]
|
|
422
|
+
|
|
352
423
|
[[package]]
|
|
353
424
|
name = "getrandom"
|
|
354
425
|
version = "0.3.4"
|
|
@@ -390,7 +461,7 @@ dependencies = [
|
|
|
390
461
|
|
|
391
462
|
[[package]]
|
|
392
463
|
name = "gitronics"
|
|
393
|
-
version = "0.6.
|
|
464
|
+
version = "0.6.4"
|
|
394
465
|
dependencies = [
|
|
395
466
|
"chrono",
|
|
396
467
|
"clap",
|
|
@@ -402,11 +473,14 @@ dependencies = [
|
|
|
402
473
|
"logtest",
|
|
403
474
|
"migjorn",
|
|
404
475
|
"path-clean",
|
|
476
|
+
"pathdiff",
|
|
405
477
|
"pyo3",
|
|
406
478
|
"rayon",
|
|
407
479
|
"regex",
|
|
408
480
|
"serde",
|
|
409
481
|
"serde-saphyr",
|
|
482
|
+
"serde_json",
|
|
483
|
+
"sha2",
|
|
410
484
|
"tempfile",
|
|
411
485
|
"thiserror",
|
|
412
486
|
"walkdir",
|
|
@@ -636,21 +710,25 @@ dependencies = [
|
|
|
636
710
|
|
|
637
711
|
[[package]]
|
|
638
712
|
name = "migjorn"
|
|
639
|
-
version = "0.
|
|
713
|
+
version = "0.3.11"
|
|
640
714
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
641
|
-
checksum = "
|
|
715
|
+
checksum = "ecf4b3b5db557a6100d1767eb22295cbd70521d1678a34584644356ff140865c"
|
|
642
716
|
dependencies = [
|
|
717
|
+
"compact_str",
|
|
643
718
|
"migjorn-syntax",
|
|
719
|
+
"rayon",
|
|
644
720
|
"rustc-hash",
|
|
645
721
|
]
|
|
646
722
|
|
|
647
723
|
[[package]]
|
|
648
724
|
name = "migjorn-syntax"
|
|
649
|
-
version = "0.
|
|
725
|
+
version = "0.3.11"
|
|
650
726
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
651
|
-
checksum = "
|
|
727
|
+
checksum = "f7bce9c260eb5e8f964a98d313dd84ceb805e979b31ecdcdef5b90a059e5eb58"
|
|
652
728
|
dependencies = [
|
|
653
|
-
"
|
|
729
|
+
"compact_str",
|
|
730
|
+
"memchr",
|
|
731
|
+
"rayon",
|
|
654
732
|
]
|
|
655
733
|
|
|
656
734
|
[[package]]
|
|
@@ -686,6 +764,12 @@ version = "1.0.1"
|
|
|
686
764
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
687
765
|
checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef"
|
|
688
766
|
|
|
767
|
+
[[package]]
|
|
768
|
+
name = "pathdiff"
|
|
769
|
+
version = "0.2.3"
|
|
770
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
771
|
+
checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
|
|
772
|
+
|
|
689
773
|
[[package]]
|
|
690
774
|
name = "pin-project-lite"
|
|
691
775
|
version = "0.2.17"
|
|
@@ -757,6 +841,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
757
841
|
checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
|
|
758
842
|
dependencies = [
|
|
759
843
|
"once_cell",
|
|
844
|
+
"python3-dll-a",
|
|
760
845
|
"target-lexicon",
|
|
761
846
|
]
|
|
762
847
|
|
|
@@ -795,6 +880,15 @@ dependencies = [
|
|
|
795
880
|
"syn",
|
|
796
881
|
]
|
|
797
882
|
|
|
883
|
+
[[package]]
|
|
884
|
+
name = "python3-dll-a"
|
|
885
|
+
version = "0.2.15"
|
|
886
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
887
|
+
checksum = "d80ba7540edb18890d444c5aa8e1f1f99b1bdf26fb26ae383135325f4a36042b"
|
|
888
|
+
dependencies = [
|
|
889
|
+
"cc",
|
|
890
|
+
]
|
|
891
|
+
|
|
798
892
|
[[package]]
|
|
799
893
|
name = "quote"
|
|
800
894
|
version = "1.0.45"
|
|
@@ -890,6 +984,12 @@ version = "1.0.22"
|
|
|
890
984
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
891
985
|
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
|
892
986
|
|
|
987
|
+
[[package]]
|
|
988
|
+
name = "ryu"
|
|
989
|
+
version = "1.0.23"
|
|
990
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
991
|
+
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
|
992
|
+
|
|
893
993
|
[[package]]
|
|
894
994
|
name = "same-file"
|
|
895
995
|
version = "1.0.6"
|
|
@@ -960,6 +1060,7 @@ version = "1.0.149"
|
|
|
960
1060
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
961
1061
|
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
962
1062
|
dependencies = [
|
|
1063
|
+
"indexmap",
|
|
963
1064
|
"itoa",
|
|
964
1065
|
"memchr",
|
|
965
1066
|
"serde",
|
|
@@ -967,6 +1068,17 @@ dependencies = [
|
|
|
967
1068
|
"zmij",
|
|
968
1069
|
]
|
|
969
1070
|
|
|
1071
|
+
[[package]]
|
|
1072
|
+
name = "sha2"
|
|
1073
|
+
version = "0.10.9"
|
|
1074
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1075
|
+
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
1076
|
+
dependencies = [
|
|
1077
|
+
"cfg-if",
|
|
1078
|
+
"cpufeatures",
|
|
1079
|
+
"digest",
|
|
1080
|
+
]
|
|
1081
|
+
|
|
970
1082
|
[[package]]
|
|
971
1083
|
name = "shlex"
|
|
972
1084
|
version = "1.3.0"
|
|
@@ -985,6 +1097,12 @@ version = "1.15.1"
|
|
|
985
1097
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
986
1098
|
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
|
987
1099
|
|
|
1100
|
+
[[package]]
|
|
1101
|
+
name = "static_assertions"
|
|
1102
|
+
version = "1.1.0"
|
|
1103
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1104
|
+
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
|
1105
|
+
|
|
988
1106
|
[[package]]
|
|
989
1107
|
name = "strsim"
|
|
990
1108
|
version = "0.11.1"
|
|
@@ -1041,6 +1159,12 @@ dependencies = [
|
|
|
1041
1159
|
"syn",
|
|
1042
1160
|
]
|
|
1043
1161
|
|
|
1162
|
+
[[package]]
|
|
1163
|
+
name = "typenum"
|
|
1164
|
+
version = "1.20.1"
|
|
1165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1166
|
+
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
|
1167
|
+
|
|
1044
1168
|
[[package]]
|
|
1045
1169
|
name = "unicode-ident"
|
|
1046
1170
|
version = "1.0.24"
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "gitronics"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.4"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
description = "Build MCNP neutronics models from modular components"
|
|
6
6
|
license = "EUPL-1.2"
|
|
7
|
+
# The published crate includes the viewer and vendored library it inlines; the
|
|
8
|
+
# viewer's test harness and its dependencies are development-only.
|
|
9
|
+
exclude = [
|
|
10
|
+
"report/test",
|
|
11
|
+
"report/node_modules",
|
|
12
|
+
"report/package.json",
|
|
13
|
+
"report/package-lock.json",
|
|
14
|
+
]
|
|
7
15
|
readme = "README.md"
|
|
8
16
|
|
|
9
17
|
[[bin]]
|
|
@@ -15,11 +23,16 @@ name = "gitronics"
|
|
|
15
23
|
crate-type = ["cdylib", "rlib"]
|
|
16
24
|
|
|
17
25
|
[dependencies]
|
|
18
|
-
pyo3 = { version = "0.23", features = [
|
|
19
|
-
|
|
26
|
+
pyo3 = { version = "0.23", features = [
|
|
27
|
+
"extension-module",
|
|
28
|
+
"abi3-py39",
|
|
29
|
+
"generate-import-lib",
|
|
30
|
+
] }
|
|
31
|
+
migjorn = "0.3.11"
|
|
20
32
|
walkdir = "2.5.0"
|
|
21
33
|
serde = { version = "1.0.228", features = ["derive"] }
|
|
22
34
|
serde-saphyr = "0.0.26"
|
|
35
|
+
serde_json = { version = "1.0", features = ["preserve_order"] }
|
|
23
36
|
thiserror = "2.0.18"
|
|
24
37
|
rayon = "1.12.0"
|
|
25
38
|
log = "0.4.29"
|
|
@@ -31,6 +44,8 @@ indexmap = { version = "2.14.0", features = ["serde"] }
|
|
|
31
44
|
git2 = "0.21.0"
|
|
32
45
|
dunce = "1.0.5"
|
|
33
46
|
path-clean = "1.0.1"
|
|
47
|
+
sha2 = "0.10"
|
|
48
|
+
pathdiff = "0.2"
|
|
34
49
|
|
|
35
50
|
[dev-dependencies]
|
|
36
51
|
tempfile = "3.0"
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="docs/assets/hero.svg" alt="Gitronics — assemble MCNP neutronics models from modular, version-controlled components" width="100%">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/Fusion4Energy/gitronics/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Fusion4Energy/gitronics/actions/workflows/ci.yml/badge.svg"></a>
|
|
7
|
+
<a href="https://pypi.org/project/gitronics/"><img alt="PyPI" src="https://img.shields.io/pypi/v/gitronics?color=F5A623&label=pypi"></a>
|
|
8
|
+
<a href="https://pypi.org/project/gitronics/"><img alt="Python" src="https://img.shields.io/pypi/pyversions/gitronics?color=F5A623"></a>
|
|
9
|
+
<a href="https://github.com/Fusion4Energy/gitronics/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-EUPL--1.2-38D9C0"></a>
|
|
10
|
+
<a href="https://fusion4energy.github.io/gitronics/latest/"><img alt="Docs" src="https://img.shields.io/badge/docs-fusion4energy.github.io-4A5768"></a>
|
|
11
|
+
<a href="https://doi.org/10.1016/j.fusengdes.2025.115248"><img alt="Publication" src="https://img.shields.io/badge/DOI-10.1016%2Fj.fusengdes.2025.115248-blue"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<b>Docs:</b> <a href="https://fusion4energy.github.io/gitronics/latest/">fusion4energy.github.io/gitronics</a>
|
|
16
|
+
·
|
|
17
|
+
<a href="https://fusion4energy.github.io/gitronics/latest/getting_started/">Getting Started</a>
|
|
18
|
+
·
|
|
19
|
+
<a href="https://fusion4energy.github.io/gitronics/latest/examples/">Examples</a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What is Gitronics?
|
|
25
|
+
|
|
26
|
+
Large [MCNP](https://mcnp.lanl.gov/) neutronics models are traditionally kept in a **single, enormous input file**. That makes them nearly impossible to review, hard to develop in parallel, and painful to turn into variants.
|
|
27
|
+
|
|
28
|
+
**Gitronics** is a methodology — and a small, fast tool — for maintaining an MCNP model as a collection of **independent, version-controlled files** that are assembled on demand:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
gitronics build configurations/baseline.yaml -o output/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Each file describes one part of the model (a piece of geometry, a set of materials, a source, a group of tallies). A [YAML](https://yaml.org/) configuration declares which pieces to combine and where — so a single `gitronics build` produces one self-contained `assembled.mcnp`.
|
|
35
|
+
|
|
36
|
+
> The Gitronics methodology already maintains some of the most complex neutronics models of the [ITER](https://www.iter.org/) fusion reactor and the [JT-60SA](https://www.jt60sa.org/) tokamak.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Why it's different
|
|
41
|
+
|
|
42
|
+
| Monolithic MCNP input | Gitronics project |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| One giant file — `git diff` is meaningless | Each component in its own file — diffs are reviewable |
|
|
45
|
+
| Variants = copy the whole file and edit | Variants = swap components via config inheritance, zero duplication |
|
|
46
|
+
| One person edits at a time | Teams develop sub-models independently, in parallel |
|
|
47
|
+
| "Which model produced this result?" | Every build stamps the **git commit hash + timestamp** into the header |
|
|
48
|
+
|
|
49
|
+
The order of every card in the output is **deterministic**, so two builds of the same configuration are byte-for-byte comparable.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## How it works
|
|
54
|
+
|
|
55
|
+
<div align="center">
|
|
56
|
+
<img src="docs/assets/flow_readme.svg" alt="Envelope structure, filler models, and data cards are combined by a YAML configuration through 'gitronics build' into a single assembled.mcnp file plus an HTML report" width="100%">
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
`gitronics build` reads a configuration, loads every referenced component, inserts the correct `FILL` cards into the envelope cells, runs validation checks (duplicate IDs, missing cards, …), and writes a single MCNP input plus an HTML build report.
|
|
60
|
+
|
|
61
|
+
A project is organized like this:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
my_project/
|
|
65
|
+
├── reference_model/
|
|
66
|
+
│ ├── envelope_structure.mcnp ← level-0 cells (the "shell")
|
|
67
|
+
│ ├── filler_models/ ← per-universe MCNP snippets
|
|
68
|
+
│ │ ├── universe_101.mcnp
|
|
69
|
+
│ │ └── universe_101.metadata
|
|
70
|
+
│ └── data_cards/
|
|
71
|
+
│ ├── materials/
|
|
72
|
+
│ ├── sources/
|
|
73
|
+
│ └── tallies/
|
|
74
|
+
├── configurations/
|
|
75
|
+
│ └── baseline.yaml ← declares which fillers go where
|
|
76
|
+
└── output/
|
|
77
|
+
└── assembled.mcnp ← produced by `gitronics build`
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
A configuration file simply maps envelope cells to the fillers and data cards that belong in them:
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
project_roots: [..]
|
|
84
|
+
|
|
85
|
+
envelope_structure: envelope_structure
|
|
86
|
+
source: volumetric_source
|
|
87
|
+
materials: [materials]
|
|
88
|
+
tallies: [fine_mesh]
|
|
89
|
+
|
|
90
|
+
envelopes:
|
|
91
|
+
blanket_sector_01_r1_c01: universe_101
|
|
92
|
+
blanket_sector_01_r1_c02: universe_103
|
|
93
|
+
divertor_cassette_18: null # intentionally left empty
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Installation
|
|
99
|
+
|
|
100
|
+
Gitronics ships as a Python package with a compiled Rust core. Pre-built wheels are on [PyPI](https://pypi.org/project/gitronics/) — no Rust toolchain required.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install gitronics
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Requirements:** Python **3.9+** on Linux, macOS (Intel & Apple Silicon), or Windows x86-64.
|
|
107
|
+
|
|
108
|
+
<details>
|
|
109
|
+
<summary>Build from source</summary>
|
|
110
|
+
|
|
111
|
+
Requires the stable [Rust toolchain](https://rustup.rs/) and [maturin](https://github.com/PyO3/maturin) ≥ 1.0.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
git clone https://github.com/Fusion4Energy/gitronics
|
|
115
|
+
cd gitronics
|
|
116
|
+
pip install maturin
|
|
117
|
+
maturin develop --release
|
|
118
|
+
# Or to generate a wheel for distribution:
|
|
119
|
+
maturin build --release --target x86_64-pc-windows-gnu --zig -i python3.12
|
|
120
|
+
```
|
|
121
|
+
</details>
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Quick start
|
|
126
|
+
|
|
127
|
+
Build the bundled example project:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
cd example_project
|
|
131
|
+
gitronics build configurations/valid_configuration.yaml --output-path output/
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
You'll find the assembled model in `output/assembled.mcnp`, with a header recording exactly how it was built:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
C ============================================================
|
|
138
|
+
C Built by gitronics v0.1.0
|
|
139
|
+
C Configuration : configurations/valid_configuration.yaml
|
|
140
|
+
C Git commit : v0.5.18-3-g04d555a
|
|
141
|
+
C Date / time : 2026-06-23 12:34:51
|
|
142
|
+
C ============================================================
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Migrate an existing model
|
|
146
|
+
|
|
147
|
+
Already have a monolithic MCNP input? Split it into a ready-to-build Gitronics project:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
gitronics migrate my_big_model.mcnp -o project/
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Python API
|
|
154
|
+
|
|
155
|
+
The same workflow is available from Python — handy for automation and parametric studies:
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
import gitronics
|
|
159
|
+
|
|
160
|
+
# Equivalent to: gitronics build configurations/baseline.yaml -o output/
|
|
161
|
+
gitronics.run(["gitronics", "build", "configurations/baseline.yaml", "-o", "output/"])
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Documentation
|
|
167
|
+
|
|
168
|
+
The full guide lives at **[fusion4energy.github.io/gitronics](https://fusion4energy.github.io/gitronics/latest/)**:
|
|
169
|
+
|
|
170
|
+
- [Concepts](https://fusion4energy.github.io/gitronics/latest/getting_started/concepts/) — the vocabulary of a Gitronics project
|
|
171
|
+
- [Project Structure](https://fusion4energy.github.io/gitronics/latest/getting_started/project_structure/) & [File Types](https://fusion4energy.github.io/gitronics/latest/getting_started/file_types/)
|
|
172
|
+
- [Configuration File](https://fusion4energy.github.io/gitronics/latest/getting_started/configuration_file/) — inheritance, overrides, and variants
|
|
173
|
+
- [Building a Model](https://fusion4energy.github.io/gitronics/latest/getting_started/building_a_model/) & [Migrating](https://fusion4energy.github.io/gitronics/latest/getting_started/migrating/)
|
|
174
|
+
- [Best Practices](https://fusion4energy.github.io/gitronics/latest/best_practices/)
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Citing Gitronics
|
|
179
|
+
|
|
180
|
+
If Gitronics supports your work, please cite:
|
|
181
|
+
|
|
182
|
+
> Cubi, A., et al. *Novel modular and Git-based approach for the management and development of radiation transport models.* Fusion Engineering and Design, 2025. [doi:10.1016/j.fusengdes.2025.115248](https://doi.org/10.1016/j.fusengdes.2025.115248)
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
Distributed under the [EUPL-1.2](LICENSE) license.
|