Skip to content

Add new div upper lower vars#4019

Merged
chris-ashe merged 6 commits intomainfrom
add_new_div_upper_lower_vars
Jan 20, 2026
Merged

Add new div upper lower vars#4019
chris-ashe merged 6 commits intomainfrom
add_new_div_upper_lower_vars

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

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

This pull request refactors how the number of divertors (n_divertors) is managed throughout the codebase. The main change is to move the ownership of n_divertors from physics_variables to a new home in divertor_variables, and to update all references accordingly. Additionally, new attributes for tracking upper and lower divertor heat loads are introduced, and relevant initialization and output routines are updated to use the new structure.

The most important changes include:

Refactoring and Data Structure Updates:

  • Moved n_divertors from physics_variables to divertor_variables, removed its definition and initialization from physics_variables.py, and updated all code to reference divertor_variables.n_divertors instead of physics_variables.n_divertors.

  • Updated the initialization logic in init.py to set divertor_variables.n_divertors instead of physics_variables.n_divertors based on the i_single_null flag. [1] [2]

Enhancements to Divertor Variables:

  • Added new attributes to divertor_variables.py for tracking lower and upper divertor neutron nuclear heat loads and incident radiation power (p_div_lower_nuclear_heat_mw, p_div_upper_nuclear_heat_mw, p_div_upper_rad_mw, p_div_lower_rad_mw), and initialized them in init_divertor_variables().

  • Implemented new run methods for LowerDivertor and UpperDivertor classes to calculate and store these new heat load and radiation attributes.

Imports and Consistency:

  • Updated imports in relevant modules to ensure divertor_variables is available where needed, and replaced usage of physics_variables.n_divertors with divertor_variables.n_divertors throughout the codebase for consistency.

These changes centralize divertor-specific configuration and results within divertor_variables, improving code organization and maintainability.## 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
Copy Markdown

codecov-commenter commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 56.25000% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.51%. Comparing base (5ea7543) to head (3b1cd7a).
⚠️ Report is 73 commits behind head on main.

Files with missing lines Patch % Lines
process/physics.py 0.00% 11 Missing ⚠️
process/divertor.py 33.33% 6 Missing ⚠️
process/build.py 0.00% 3 Missing ⚠️
process/init.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4019      +/-   ##
==========================================
+ Coverage   46.49%   46.51%   +0.01%     
==========================================
  Files         123      123              
  Lines       28777    28798      +21     
==========================================
+ Hits        13381    13396      +15     
- Misses      15396    15402       +6     

☔ 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 force-pushed the add_new_div_upper_lower_vars branch from fa2a54a to 3dac541 Compare January 20, 2026 13:18
@chris-ashe chris-ashe force-pushed the add_new_div_upper_lower_vars branch from 3dac541 to 3b1cd7a Compare January 20, 2026 13:36
@chris-ashe chris-ashe marked this pull request as ready for review January 20, 2026 13:37
@chris-ashe chris-ashe requested a review from j-a-foster January 20, 2026 14:36
Copy link
Copy Markdown
Collaborator

@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

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

Happy with variable changes.

@chris-ashe chris-ashe removed the request for review from timothy-nunn January 20, 2026 15:03
@chris-ashe chris-ashe merged commit 3327be9 into main Jan 20, 2026
20 checks passed
@chris-ashe chris-ashe deleted the add_new_div_upper_lower_vars branch January 20, 2026 15:03
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.

3 participants