Skip to content

Add plasma ignited enum#4424

Merged
timothy-nunn merged 3 commits into
mainfrom
add_plasma_ignited_enum
Jul 9, 2026
Merged

Add plasma ignited enum#4424
timothy-nunn merged 3 commits into
mainfrom
add_plasma_ignited_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.

@chris-ashe chris-ashe requested a review from a team as a code owner July 9, 2026 08:19
@chris-ashe chris-ashe added Physics Relating to the physics models Refactor labels Jul 9, 2026
@chris-ashe chris-ashe requested a review from timothy-nunn July 9, 2026 08:20
@codecov-commenter

codecov-commenter commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.87%. Comparing base (d54820c) to head (eb3540f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/models/physics/current_drive.py 66.66% 1 Missing ⚠️
process/models/physics/physics.py 50.00% 1 Missing ⚠️
process/models/stellarator/heating.py 50.00% 1 Missing ⚠️
process/models/stellarator/stellarator.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4424      +/-   ##
==========================================
+ Coverage   48.85%   48.87%   +0.01%     
==========================================
  Files         151      151              
  Lines       29390    29424      +34     
==========================================
+ Hits        14359    14381      +22     
- Misses      15031    15043      +12     

☔ View full report in Codecov by Harness.
📢 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.

@timothy-nunn timothy-nunn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would suggest adding validation in a few more places to ensure we error if the switch value is invalid.

Comment thread process/core/solver/constraints.py Outdated
+ data.current_drive.p_hcd_injected_total_mw / data.physics.vol_plasma
)
else:
elif data.physics.i_plasma_ignited == PlasmaIgnitionModel.IGNITED:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
elif data.physics.i_plasma_ignited == PlasmaIgnitionModel.IGNITED:
else:

Instead of going this I would suggest validating data.physics.i_plasma_ignited e.g. by doing PlasmaIgnitionModel(data.physics.i_plasma_ignited) that way an error will be raised if the switch is not in the enum

Comment thread process/core/solver/constraints.py Outdated
+ data.current_drive.p_hcd_injected_electrons_mw / data.physics.vol_plasma
)
else:
elif data.physics.i_plasma_ignited == PlasmaIgnitionModel.IGNITED:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here

Suggested change
elif data.physics.i_plasma_ignited == PlasmaIgnitionModel.IGNITED:
else:

Comment thread process/core/solver/constraints.py Outdated
+ data.current_drive.p_hcd_primary_extra_heat_mw
)
else:
elif data.physics.i_plasma_ignited == PlasmaIgnitionModel.IGNITED:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
elif data.physics.i_plasma_ignited == PlasmaIgnitionModel.IGNITED:
else:

@chris-ashe chris-ashe requested a review from timothy-nunn July 9, 2026 12:18
@timothy-nunn timothy-nunn merged commit 1eeee1f into main Jul 9, 2026
10 of 11 checks passed
@timothy-nunn timothy-nunn deleted the add_plasma_ignited_enum branch July 9, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Physics Relating to the physics models Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants