You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reading of a FMESH for GVRs with cylindrical coordinates was wrong in the calculation of the directior vectors. They are not the AXS and VEC vectors from MCNP. It is fixed now.
Summary by CodeRabbit
Bug Fixes
Corrected origin coordinate extraction in meshtally header parsing to ensure accurate spatial positioning of weight window geometry with proper (x, y, z) component ordering.
Improved cylindrical mesh director vector handling with enhanced geometric transformations that properly account for mesh radius, height, and spatial positioning parameters.
This PR modernizes Python type hints across the weight window GVR module by replacing typing module aliases (Dict, List, Tuple, Union, Optional) with modern built-in syntax (dict, list, tuple, |). Additionally, it introduces director vector transformation logic for cylindrical mesh parsing.
Changes
Cohort / File(s)
Summary
Type Hint Modernization src/f4enix/input/ww_gvr/cli.py, src/f4enix/input/ww_gvr/models.py, src/f4enix/input/ww_gvr/utils.py
Updated public and internal type annotations to use modern syntax: Dict → dict, List → list, Tuple → tuple, Optional[T] → T | None, Union[A, B] → A | B. Removed unused typing module imports.
Modernized type hints for WWHeader and WWHeaderCyl fields (ne, origin, director_1, director_2). Added director transformation logic for cylindrical meshes using height and radius scaling; transforms director vectors based on cylinder geometry and origin coordinates.
Test Updates tests/test_ww_gvr/test_ww_parser.py
Updated cylindrical meshtally test case to reflect transformed director vectors ([0.0, -50.0, -50.0] and [-50.0, -50.0, 0.0]) in expected header configuration.
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
dodu94
Poem
🐰 Python types now shine so bright, Modern syntax feels so right, Dict and list in lowercase flow, Cylindrical directors now transform just so! ✨
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reading of a FMESH for GVRs with cylindrical coordinates was wrong in the calculation of the directior vectors. They are not the AXS and VEC vectors from MCNP. It is fixed now.
Summary by CodeRabbit