gitronics 0.5.22__tar.gz → 0.5.24__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.5.22 → gitronics-0.5.24}/Cargo.lock +8 -1
- {gitronics-0.5.22 → gitronics-0.5.24}/Cargo.toml +2 -1
- {gitronics-0.5.22 → gitronics-0.5.24}/PKG-INFO +1 -1
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/index.md +5 -2
- {gitronics-0.5.22 → gitronics-0.5.24}/src/utils.rs +24 -4
- {gitronics-0.5.22 → gitronics-0.5.24}/.github/workflows/ci.yml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/.github/workflows/docs.yml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/.github/workflows/release.yml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/.gitignore +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/.vscode/settings.json +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/LICENSE +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/README.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/assets/logo.png +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/best_practices.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/examples.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/assessments.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/building_a_model.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/card_id_numbers.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/concepts.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/configuration_file.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/file_types.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/migrating.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/new_project.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started/project_structure.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/getting_started.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/hooks/version_from_git.py +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/installation.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/requirements.txt +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/usage/build.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/docs/usage/migrate.md +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/assessment_specific/filler_model_3.mcnp +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/assessment_specific/filler_model_3.metadata +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/assessment_specific/small_override.yaml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/configurations/valid_configuration.yaml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/output/.gitignore +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/data_cards/fine_mesh.tally +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/data_cards/materials.mat +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/data_cards/my_transform.transform +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/data_cards/volumetric_source.source +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/envelope_structure.mcnp +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/envelope_structure.metadata +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/filler_models/filler_model_1.mcnp +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/filler_models/filler_model_1.metadata +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/filler_models/filler_model_2.mcnp +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/filler_models/filler_model_2.metadata +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/mkdocs.yml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/pyproject.toml +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/python/gitronics/__init__.py +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/python/gitronics/__main__.py +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/python/gitronics/gitronics.pyi +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/python/tests/test_build_model.py +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/python/tests/test_cli_works.py +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/resources/simple_model.mcnp +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/build_model.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/build_report.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/cli.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/lib.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/main.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/migrate_model.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/model_config.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/project_manager/load_metadata.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/project_manager/load_model_config.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/project_manager/load_project_files.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/project_manager.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/python.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/report.css +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/src/types.rs +0 -0
- {gitronics-0.5.22 → gitronics-0.5.24}/tests/test_example_project.rs +0 -0
|
@@ -390,7 +390,7 @@ dependencies = [
|
|
|
390
390
|
|
|
391
391
|
[[package]]
|
|
392
392
|
name = "gitronics"
|
|
393
|
-
version = "0.5.
|
|
393
|
+
version = "0.5.24"
|
|
394
394
|
dependencies = [
|
|
395
395
|
"chrono",
|
|
396
396
|
"clap",
|
|
@@ -401,6 +401,7 @@ dependencies = [
|
|
|
401
401
|
"log",
|
|
402
402
|
"logtest",
|
|
403
403
|
"migjorn",
|
|
404
|
+
"path-clean",
|
|
404
405
|
"pyo3",
|
|
405
406
|
"rayon",
|
|
406
407
|
"regex",
|
|
@@ -672,6 +673,12 @@ version = "1.70.2"
|
|
|
672
673
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
673
674
|
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
674
675
|
|
|
676
|
+
[[package]]
|
|
677
|
+
name = "path-clean"
|
|
678
|
+
version = "1.0.1"
|
|
679
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
680
|
+
checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef"
|
|
681
|
+
|
|
675
682
|
[[package]]
|
|
676
683
|
name = "pin-project-lite"
|
|
677
684
|
version = "0.2.17"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "gitronics"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.24"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
description = "Build MCNP neutronics models from modular components"
|
|
6
6
|
license = "EUPL-1.2"
|
|
@@ -30,6 +30,7 @@ clap = { version = "4.6.1", features = ["derive"] }
|
|
|
30
30
|
indexmap = { version = "2.14.0", features = ["serde"] }
|
|
31
31
|
git2 = "0.21.0"
|
|
32
32
|
dunce = "1.0.5"
|
|
33
|
+
path-clean = "1.0.1"
|
|
33
34
|
|
|
34
35
|
[dev-dependencies]
|
|
35
36
|
tempfile = "3.0"
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Gitronics
|
|
2
2
|
|
|
3
|
-
**Gitronics** is a tool for assembling [MCNP](https://mcnp.lanl.gov/) neutronics models from modular, version-controlled components.
|
|
3
|
+
**Gitronics** is a methodology and accompanying tool for mantaining and assembling [MCNP](https://mcnp.lanl.gov/) neutronics models from modular, version-controlled components.
|
|
4
4
|
|
|
5
|
-
Instead of maintaining a single monolithic MCNP input file, Gitronics lets you
|
|
5
|
+
Instead of maintaining a single monolithic MCNP input file, Gitronics lets you manage a collection of independent files that can be assembled into a complete MCNP model by running the command `gitronics build`.
|
|
6
|
+
Each file can represent a different aspect of the model, such as the geometry of a system, a set of materials, a source definition or a collection of tallies.
|
|
7
|
+
The assembly process is controlled by a [YAML](https://yaml.org/) configuration file, which specifies which components to include and how to combine them.
|
|
8
|
+
The use of configuration files allows you to create multiple variants of a model without duplicating files, and to easily swap components in and out.
|
|
6
9
|
|
|
7
10
|
This workflow enables:
|
|
8
11
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
use crate::types::{EnvelopeName, FileName, FillerName};
|
|
9
9
|
use log::LevelFilter;
|
|
10
|
+
use path_clean::PathClean;
|
|
10
11
|
use std::collections::HashMap;
|
|
11
12
|
use std::collections::hash_map::Entry;
|
|
12
13
|
use std::io;
|
|
@@ -90,11 +91,15 @@ pub enum GitronicsError {
|
|
|
90
91
|
|
|
91
92
|
impl GitronicsError {
|
|
92
93
|
pub fn io_path(path: impl AsRef<Path>, source: io::Error) -> Self {
|
|
94
|
+
let path_ref = path.as_ref();
|
|
95
|
+
|
|
96
|
+
let cleaned_path = dunce::canonicalize(path_ref)
|
|
97
|
+
.unwrap_or_else(|_| path_ref.to_path_buf().clean())
|
|
98
|
+
.display()
|
|
99
|
+
.to_string();
|
|
100
|
+
|
|
93
101
|
Self::IoPath {
|
|
94
|
-
path:
|
|
95
|
-
.unwrap_or_else(|_| path.as_ref().to_path_buf())
|
|
96
|
-
.display()
|
|
97
|
-
.to_string(),
|
|
102
|
+
path: cleaned_path,
|
|
98
103
|
source,
|
|
99
104
|
}
|
|
100
105
|
}
|
|
@@ -211,4 +216,19 @@ mod tests {
|
|
|
211
216
|
let err = get_file_paths(dir.path()).unwrap_err();
|
|
212
217
|
assert!(err.to_string().contains("Duplicate file name `file1`"));
|
|
213
218
|
}
|
|
219
|
+
|
|
220
|
+
#[test]
|
|
221
|
+
fn test_io_path_normalizes_parent_segments_when_not_canonicalizable() {
|
|
222
|
+
let err = GitronicsError::io_path(
|
|
223
|
+
Path::new("non_existing/../clean/path.yaml"),
|
|
224
|
+
io::Error::new(io::ErrorKind::NotFound, "missing"),
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
match err {
|
|
228
|
+
GitronicsError::IoPath { path, .. } => {
|
|
229
|
+
assert_eq!(Path::new(&path), Path::new("clean/path.yaml"));
|
|
230
|
+
}
|
|
231
|
+
_ => panic!("Expected IoPath error"),
|
|
232
|
+
}
|
|
233
|
+
}
|
|
214
234
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/assessment_specific/filler_model_3.mcnp
RENAMED
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/assessment_specific/filler_model_3.metadata
RENAMED
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/assessment_specific/small_override.yaml
RENAMED
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/configurations/valid_configuration.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/data_cards/fine_mesh.tally
RENAMED
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/data_cards/materials.mat
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/envelope_structure.mcnp
RENAMED
|
File without changes
|
{gitronics-0.5.22 → gitronics-0.5.24}/example_project/reference_model/envelope_structure.metadata
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|