gitronics 0.5.8__tar.gz → 0.5.10__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 (58) hide show
  1. {gitronics-0.5.8 → gitronics-0.5.10}/Cargo.lock +1 -1
  2. {gitronics-0.5.8 → gitronics-0.5.10}/Cargo.toml +1 -1
  3. {gitronics-0.5.8 → gitronics-0.5.10}/PKG-INFO +1 -1
  4. {gitronics-0.5.8 → gitronics-0.5.10}/src/build_model.rs +1 -0
  5. {gitronics-0.5.8 → gitronics-0.5.10}/src/model_config.rs +2 -1
  6. {gitronics-0.5.8 → gitronics-0.5.10}/src/project_manager/load_metadata.rs +2 -1
  7. {gitronics-0.5.8 → gitronics-0.5.10}/src/project_manager.rs +6 -1
  8. {gitronics-0.5.8 → gitronics-0.5.10}/src/utils.rs +16 -0
  9. {gitronics-0.5.8 → gitronics-0.5.10}/.github/workflows/ci.yml +0 -0
  10. {gitronics-0.5.8 → gitronics-0.5.10}/.github/workflows/docs.yml +0 -0
  11. {gitronics-0.5.8 → gitronics-0.5.10}/.github/workflows/release.yml +0 -0
  12. {gitronics-0.5.8 → gitronics-0.5.10}/.gitignore +0 -0
  13. {gitronics-0.5.8 → gitronics-0.5.10}/.vscode/settings.json +0 -0
  14. {gitronics-0.5.8 → gitronics-0.5.10}/LICENSE +0 -0
  15. {gitronics-0.5.8 → gitronics-0.5.10}/README.md +0 -0
  16. {gitronics-0.5.8 → gitronics-0.5.10}/docs/assets/logo.png +0 -0
  17. {gitronics-0.5.8 → gitronics-0.5.10}/docs/best-practices.md +0 -0
  18. {gitronics-0.5.8 → gitronics-0.5.10}/docs/changelog.md +0 -0
  19. {gitronics-0.5.8 → gitronics-0.5.10}/docs/examples.md +0 -0
  20. {gitronics-0.5.8 → gitronics-0.5.10}/docs/getting-started.md +0 -0
  21. {gitronics-0.5.8 → gitronics-0.5.10}/docs/index.md +0 -0
  22. {gitronics-0.5.8 → gitronics-0.5.10}/docs/installation.md +0 -0
  23. {gitronics-0.5.8 → gitronics-0.5.10}/docs/requirements.txt +0 -0
  24. {gitronics-0.5.8 → gitronics-0.5.10}/docs/usage/build.md +0 -0
  25. {gitronics-0.5.8 → gitronics-0.5.10}/docs/usage/configuration.md +0 -0
  26. {gitronics-0.5.8 → gitronics-0.5.10}/docs/usage/migrate.md +0 -0
  27. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/assessment_specific/filler_model_3.mcnp +0 -0
  28. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/assessment_specific/filler_model_3.metadata +0 -0
  29. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/assessment_specific/small_override.yaml +0 -0
  30. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/configurations/valid_configuration.yaml +0 -0
  31. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/output/.gitignore +0 -0
  32. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/data_cards/fine_mesh.tally +0 -0
  33. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/data_cards/materials.mat +0 -0
  34. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/data_cards/my_transform.transform +0 -0
  35. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/data_cards/volumetric_source.source +0 -0
  36. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/envelope_structure.mcnp +0 -0
  37. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/envelope_structure.metadata +0 -0
  38. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/filler_models/filler_model_1.mcnp +0 -0
  39. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/filler_models/filler_model_1.metadata +0 -0
  40. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/filler_models/filler_model_2.mcnp +0 -0
  41. {gitronics-0.5.8 → gitronics-0.5.10}/example_project/reference_model/filler_models/filler_model_2.metadata +0 -0
  42. {gitronics-0.5.8 → gitronics-0.5.10}/mkdocs.yml +0 -0
  43. {gitronics-0.5.8 → gitronics-0.5.10}/pyproject.toml +0 -0
  44. {gitronics-0.5.8 → gitronics-0.5.10}/python/gitronics/__init__.py +0 -0
  45. {gitronics-0.5.8 → gitronics-0.5.10}/python/gitronics/__main__.py +0 -0
  46. {gitronics-0.5.8 → gitronics-0.5.10}/python/gitronics/gitronics.pyi +0 -0
  47. {gitronics-0.5.8 → gitronics-0.5.10}/python/tests/test_build_model.py +0 -0
  48. {gitronics-0.5.8 → gitronics-0.5.10}/python/tests/test_cli_works.py +0 -0
  49. {gitronics-0.5.8 → gitronics-0.5.10}/resources/simple_model.mcnp +0 -0
  50. {gitronics-0.5.8 → gitronics-0.5.10}/src/cli.rs +0 -0
  51. {gitronics-0.5.8 → gitronics-0.5.10}/src/lib.rs +0 -0
  52. {gitronics-0.5.8 → gitronics-0.5.10}/src/main.rs +0 -0
  53. {gitronics-0.5.8 → gitronics-0.5.10}/src/migrate_model.rs +0 -0
  54. {gitronics-0.5.8 → gitronics-0.5.10}/src/project_manager/load_model_config.rs +0 -0
  55. {gitronics-0.5.8 → gitronics-0.5.10}/src/project_manager/load_project_files.rs +0 -0
  56. {gitronics-0.5.8 → gitronics-0.5.10}/src/python.rs +0 -0
  57. {gitronics-0.5.8 → gitronics-0.5.10}/src/types.rs +0 -0
  58. {gitronics-0.5.8 → gitronics-0.5.10}/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.8"
393
+ version = "0.5.10"
394
394
  dependencies = [
395
395
  "chrono",
396
396
  "clap",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "gitronics"
3
- version = "0.5.8"
3
+ version = "0.5.10"
4
4
  edition = "2024"
5
5
  description = "Build MCNP neutronics models from modular components"
6
6
  license = "EUPL-1.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitronics
3
- Version: 0.5.8
3
+ Version: 0.5.10
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -63,6 +63,7 @@ pub fn build_model(config_path: &Path, output_path: &Path) -> Result<(), Gitroni
63
63
  .map_err(|e| GitronicsError::ValidationError(e.to_string()))?;
64
64
 
65
65
  // Write model
66
+ info!("Writing assembled model to file");
66
67
  let assembled_path = project_manager.output_path().join("assembled.mcnp");
67
68
  write_assembled_header(&mut envelope_structure, config_path)?;
68
69
  envelope_structure.write_to_file(&assembled_path)?;
@@ -39,7 +39,8 @@ impl ModelConfig {
39
39
 
40
40
  /// Parses a model configuration from a YAML file.
41
41
  pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, GitronicsError> {
42
- let yaml_content = fs::read_to_string(&path)?;
42
+ let yaml_content =
43
+ fs::read_to_string(&path).map_err(|source| GitronicsError::io_path(&path, source))?;
43
44
  let mut config: ModelConfig = serde_saphyr::from_str(&yaml_content).map_err(|e| {
44
45
  GitronicsError::YamlParse(path.as_ref().to_string_lossy().to_string(), e.to_string())
45
46
  })?;
@@ -24,7 +24,8 @@ impl ProjectManager {
24
24
  if !metadata_path.exists() {
25
25
  return Err(GitronicsError::MetadataNotFound(filler_name.into()));
26
26
  }
27
- let yaml_content = fs::read_to_string(&metadata_path)?;
27
+ let yaml_content = fs::read_to_string(&metadata_path)
28
+ .map_err(|source| GitronicsError::io_path(&metadata_path, source))?;
28
29
  let filler_metadata: FillerMetadata =
29
30
  serde_saphyr::from_str(&yaml_content).map_err(|e| {
30
31
  GitronicsError::YamlParse(
@@ -48,7 +48,12 @@ impl ProjectManager {
48
48
  .model_config
49
49
  .project_roots()
50
50
  .iter()
51
- .map(|p| p.to_string_lossy().to_string())
51
+ .map(|p| {
52
+ dunce::canonicalize(p)
53
+ .unwrap_or_else(|_| p.clone())
54
+ .to_string_lossy()
55
+ .to_string()
56
+ })
52
57
  .collect::<Vec<_>>()
53
58
  .join(", "),
54
59
  })
@@ -19,6 +19,13 @@ const VALID_SUFFIXES: &[&str] = &["yaml", "yml", "mcnp", "mat", "tally", "transf
19
19
 
20
20
  #[derive(Debug, Error)]
21
21
  pub enum GitronicsError {
22
+ #[error("I/O error at `{path}`: {source}")]
23
+ IoPath {
24
+ path: String,
25
+ #[source]
26
+ source: io::Error,
27
+ },
28
+
22
29
  #[error("I/O error occurred: `{0}`")]
23
30
  Io(#[from] io::Error),
24
31
 
@@ -81,6 +88,15 @@ pub enum GitronicsError {
81
88
  ValidationError(String),
82
89
  }
83
90
 
91
+ impl GitronicsError {
92
+ pub fn io_path(path: impl AsRef<Path>, source: io::Error) -> Self {
93
+ Self::IoPath {
94
+ path: path.as_ref().display().to_string(),
95
+ source,
96
+ }
97
+ }
98
+ }
99
+
84
100
  /// Recursively discovers and indexes all project files by their stem names.
85
101
  ///
86
102
  /// Walks through the given directory tree and collects files with valid suffixes
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