Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Dec 3, 2025

This pull request refactors the blanket geometry and pumping power calculation logic in the blanket library and its users. The main improvements are the introduction of dedicated InboardBlanket and OutboardBlanket classes with clearer geometry calculation methods, and the refactoring of the pumping power calculation into a function with explicit arguments and return values. These changes increase modularity, clarity, and maintainability of the code, especially for the DCLL and HCPB blanket models.

Refactoring and modularization of blanket geometry:

  • Introduced new InboardBlanket and OutboardBlanket classes in blanket_library.py, each encapsulating their respective geometry calculations, and updated DCLL and HCPB blanket models to inherit from these classes instead of the generic BlanketLibrary (process/blanket_library.py, process/dcll.py, process/hcpb.py). [1] [2] [3] [4] [5]
  • Moved the calculation of toroidal segment lengths for inboard and outboard blankets into dedicated methods (set_blanket_inboard_module_geometry, set_blanket_outboard_module_geometry) and updated their usage in DCLL and HCPB run methods (process/blanket_library.py, process/dcll.py, process/hcpb.py). [1] [2] [3]
  • Removed the direct calculation of segment lengths from set_blanket_module_geometry, delegating this responsibility to the new methods and the respective blanket classes (process/blanket_library.py).

Refactoring of pumping power calculation:

  • Refactored set_pumping_powers_as_fractions from a state-mutating function to a pure function with explicit arguments and return values, improving clarity and testability. Updated all usages to unpack the returned tuple and assign the results (process/blanket_library.py, process/dcll.py, process/hcpb.py). [1] [2] [3]

Code cleanup and logic improvements:

  • Removed redundant or now-unnecessary calls to geometry setup methods in the thermo-hydraulic model, as this is now handled in the blanket-specific classes (process/blanket_library.py).

These changes collectively make the codebase more modular, easier to extend for new blanket types, and clearer in terms of data flow and responsibility separation.## Description

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 31.42857% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.56%. Comparing base (26bfc59) to head (95da307).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/blanket_library.py 30.43% 16 Missing ⚠️
process/dcll.py 33.33% 4 Missing ⚠️
process/hcpb.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3997      +/-   ##
==========================================
- Coverage   46.03%   43.56%   -2.48%     
==========================================
  Files         123      123              
  Lines       28964    30818    +1854     
==========================================
+ Hits        13335    13427      +92     
- Misses      15629    17391    +1762     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chris-ashe chris-ashe marked this pull request as ready for review December 3, 2025 16:09
@chris-ashe chris-ashe changed the title Create outboard blanket class ♻️ Create outboard blanket class Dec 3, 2025
@timothy-nunn timothy-nunn mentioned this pull request Dec 15, 2025
6 tasks
@chris-ashe chris-ashe merged commit 2f754a2 into main Dec 17, 2025
26 of 27 checks passed
@je-cook je-cook deleted the create_outboard_blanket_class branch January 5, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants