Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Nov 14, 2025

This pull request refactors the calculation of the central solenoid (CS) cross-sectional area in the toroidal field (TF) coil stress routine. The main change is to remove the dependence on the geometric parameters z_tf_inside_half and f_z_cs_tf_internal and instead use a new parameter, a_cs_poloidal, which represents the CS poloidal cross-sectional area. This simplifies the interface and makes the code more robust and maintainable. The changes are consistently applied across the main codebase and the unit tests.

Refactoring of CS cross-sectional area calculation:

  • The stresscl function in process/tf_coil.py now takes a_cs_poloidal as an argument instead of calculating the CS area from z_tf_inside_half and f_z_cs_tf_internal. The code for this calculation has been removed, and all usages now reference a_cs_poloidal directly.
  • The run methods in both process/resistive_tf_coil.py and process/superconducting_tf_coil.py have been updated to pass a_cs_poloidal to stresscl, and the now-unused parameters have been removed from the function calls.

Updates to unit tests:

  • The StressclParam test parameter class and all test cases in tests/unit/test_tfcoil.py have been updated to use a_cs_poloidal instead of z_tf_inside_half and f_z_cs_tf_internal. All relevant test code and expected values have been modified accordingly.

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 self-assigned this Nov 14, 2025
@chris-ashe chris-ashe added Refactor TF Coil Toroidal field coil labels Nov 14, 2025
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 46.05%. Comparing base (5eeaeff) to head (b4f6f98).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
process/tf_coil.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3986   +/-   ##
=======================================
  Coverage   46.05%   46.05%           
=======================================
  Files         123      123           
  Lines       28737    28734    -3     
=======================================
  Hits        13234    13234           
+ Misses      15503    15500    -3     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor TF Coil Toroidal field coil

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants