Skip to content

Fix gvr cyl bug#192

Merged
dodu94 merged 3 commits intodevelopingfrom
fix-gvr-cyl-bug
Feb 9, 2026
Merged

Fix gvr cyl bug#192
dodu94 merged 3 commits intodevelopingfrom
fix-gvr-cyl-bug

Conversation

@AlvaroCubi
Copy link
Collaborator

@AlvaroCubi AlvaroCubi commented Feb 6, 2026

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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

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: Dictdict, Listlist, Tupletuple, Optional[T]T | None, Union[A, B]A | B. Removed unused typing module imports.
Parser Updates
src/f4enix/input/ww_gvr/ww_parser.py
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!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix gvr cyl bug' is vague and does not clearly describe what the pull request does; it uses generic terminology without context. Consider a more descriptive title like 'Fix cylindrical FMESH director vector calculation in GVR parser' to clearly communicate the main change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-gvr-cyl-bug

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/f4enix/input/ww_gvr/cli.py 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/f4enix/input/ww_gvr/models.py 100.00% <100.00%> (ø)
src/f4enix/input/ww_gvr/utils.py 100.00% <100.00%> (ø)
src/f4enix/input/ww_gvr/ww_parser.py 98.46% <100.00%> (+0.03%) ⬆️
src/f4enix/input/ww_gvr/cli.py 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@dodu94 dodu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ!

@dodu94 dodu94 merged commit 263bc70 into developing Feb 9, 2026
7 of 8 checks passed
@dodu94 dodu94 deleted the fix-gvr-cyl-bug branch February 9, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants