Skip to content

Add enumeration for first wall and blanket coolant loop types#4210

Merged
je-cook merged 1 commit intomainfrom
add_i_fw_blkt_shared_coolant_enum
Apr 29, 2026
Merged

Add enumeration for first wall and blanket coolant loop types#4210
je-cook merged 1 commit intomainfrom
add_i_fw_blkt_shared_coolant_enum

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

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.

Copilot AI review requested due to automatic review settings April 28, 2026 15:58
@chris-ashe chris-ashe requested a review from a team as a code owner April 28, 2026 15:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a named enumeration for the “shared vs separate” first-wall / blanket primary coolant loop configuration and replaces several hard-coded 0/1 comparisons/assignments with the enum values inside the blanket thermal-hydraulic calculations.

Changes:

  • Add FWBlktCoolantLoopTypes(IntEnum) for i_fw_blkt_shared_coolant.
  • Replace several assignments and conditionals in primary_coolant_properties() and thermo_hydraulic_model() to use the enum members instead of raw integers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +685 to +687
i_fw_blkt_shared_coolant = FWBlktCoolantLoopTypes(
fwbs_variables.i_fw_blkt_shared_coolant
)
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

FWBlktCoolantLoopTypes(...) will raise ValueError if fwbs_variables.i_fw_blkt_shared_coolant is 2, but the input layer currently allows choices=[0, 1, 2] for this variable (process/core/input.py:1915-1917). This introduces a runtime crash vs the prior numeric comparison logic. Either (a) extend the enum to cover the 2 case (and document what it means), (b) tighten input validation to only allow 0/1, or (c) avoid casting here and compare the raw value to the enum members (since IntEnum already compares equal to int). Consider adding a unit test to cover the non-0/1 path so this can’t regress.

Suggested change
i_fw_blkt_shared_coolant = FWBlktCoolantLoopTypes(
fwbs_variables.i_fw_blkt_shared_coolant
)
# Compare the raw value directly to the IntEnum member rather than
# coercing it to FWBlktCoolantLoopTypes. The input layer currently
# permits values beyond the defined enum members, and IntEnum values
# compare equal to ints without raising ValueError for those cases.
i_fw_blkt_shared_coolant = fwbs_variables.i_fw_blkt_shared_coolant

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 28.57143% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.12%. Comparing base (205f3b6) to head (a2a20cf).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/models/blankets/blanket_library.py 28.57% 15 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4210   +/-   ##
=======================================
  Coverage   52.11%   52.12%           
=======================================
  Files         148      148           
  Lines       30406    30411    +5     
=======================================
+ Hits        15847    15852    +5     
  Misses      14559    14559           

☔ 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.

@je-cook je-cook self-assigned this Apr 29, 2026
@je-cook je-cook enabled auto-merge (squash) April 29, 2026 12:24
@chris-ashe chris-ashe force-pushed the add_i_fw_blkt_shared_coolant_enum branch from c58880c to a2a20cf Compare April 29, 2026 13:47
@je-cook je-cook merged commit 14ef433 into main Apr 29, 2026
10 of 11 checks passed
@je-cook je-cook deleted the add_i_fw_blkt_shared_coolant_enum branch April 29, 2026 14:00
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