Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4144 +/- ##
==========================================
+ Coverage 47.82% 48.06% +0.23%
==========================================
Files 143 144 +1
Lines 29991 30133 +142
==========================================
+ Hits 14342 14482 +140
- Misses 15649 15651 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…l_field for clarity and consistency
…ng detailed explanations for toroidal and poloidal fields, including calculation methods and equations.
… update usage in Physics class
3c25bc1 to
012c0e7
Compare
j-a-foster
requested changes
Mar 27, 2026
Collaborator
j-a-foster
left a comment
There was a problem hiding this comment.
Some minor changes to the docs but otherwise happy with the changes.
…ulation in documentation
72ac41d to
2105bd3
Compare
timothy-nunn
requested changes
Mar 31, 2026
process/models/physics/physics.py
Outdated
Comment on lines
+2045
to
+2053
| "Plasma surface averaged poloidal field (T)", | ||
| "(b_plasma_surface_poloidal_average)", | ||
| physics_variables.b_plasma_surface_poloidal_average, | ||
| "OP ", | ||
| ) | ||
|
|
||
| po.ovarrf( | ||
| self.outfile, | ||
| "Total field (sqrt(b_plasma_poloidal_average^2 + b_plasma_toroidal_on_axis^2)) (T)", | ||
| "Total field (sqrt(b_plasma_surface_poloidal_average^2 + b_plasma_toroidal_on_axis^2)) (T)", |
Collaborator
There was a problem hiding this comment.
Can you move the output to the new model (even though, for now, the variable is set in this model while physics is untangled)
timothy-nunn
requested changes
Apr 1, 2026
…te usage in Physics class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
PlasmaFieldsmodel to centralize and clarify the calculation of tokamak plasma magnetic fields. It replaces the previous use ofb_plasma_poloidal_averagewithb_plasma_surface_poloidal_averagethroughout the codebase and documentation, ensuring consistent terminology and improved accuracy. Additionally, it updates documentation, plotting, and output routines to reflect these changes and provides a new, detailed documentation page for magnetic field calculations.Key changes:
Magnetic Field Calculation Refactor:
PlasmaFieldsmodel to encapsulate all magnetic field calculations, including toroidal, poloidal, and total magnetic fields. All relevant calculations inphysics.pynow use this model.🔄 Renames
b_plasma_poloidal_averagewithb_plasma_surface_poloidal_averagein the codebase, including variable definitions, initializations, function arguments, and output routines.Documentation Improvements:
plasma_magnetic_fields.md, providing detailed explanations and equations for toroidal and poloidal magnetic fields in tokamaks.Plotting and Output Updates:
b_plasma_surface_poloidal_averagevariable and improved the layout of magnetic field information on plots.These changes ensure a more accurate and maintainable approach to magnetic field calculations and documentation in the codebase.## Description
Checklist
I confirm that I have completed the following checks: