Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4201 +/- ##
==========================================
+ Coverage 52.07% 52.10% +0.02%
==========================================
Files 148 148
Lines 30321 30365 +44
==========================================
+ Hits 15791 15822 +31
- Misses 14530 14543 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds explicit TF coil midplane radial thickness outputs (full/external and internal) to the TF coil model, surfaces them in output/MFILE, and updates plotting and unit tests to use the new values.
Changes:
- Refactor
tf_global_geometryto return aTFGlobalGeometrydataclass and adddr_tf_full_midplane/dr_tf_internal_midplanecalculations. - Persist the new midplane thickness values into
tfcoil_variablesand output them viaouttf. - Update summary plotting and unit tests to consume the new midplane thickness values.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
process/models/tfcoil/base.py |
Introduces TFGlobalGeometry dataclass, computes/stores new midplane thickness variables, and outputs them. |
process/data_structure/tfcoil_variables.py |
Adds new TF coil variable slots and initializes them. |
process/core/io/plot/summary.py |
Updates TF coil structure plot labels to use dr_tf_*_midplane from MFILE. |
tests/unit/models/tfcoil/test_tfcoil.py |
Updates unit tests for the new return type and verifies the new thickness values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
10072
to
10076
| axis.text( | ||
| (r_tf_inboard_out + r_tf_outboard_in) / 1.5, | ||
| -z_tf_inside_half / 12, | ||
| f"{r_tf_outboard_in - r_tf_inboard_in:.3f} m", | ||
| f"{mfile.get('dr_tf_internal_midplane', scan=scan):.3f} m", | ||
| fontsize=7, |
Comment on lines
10096
to
10100
| axis.text( | ||
| (r_tf_inboard_out + r_tf_outboard_in) / 1.5, | ||
| 0.0, | ||
| f"{(r_tf_outboard_in + dr_tf_outboard) - r_tf_inboard_in:.3f} m", | ||
| f"{mfile.get('dr_tf_full_midplane', scan=scan):.3f} m", | ||
| fontsize=7, |
je-cook
requested changes
Apr 20, 2026
959bf16 to
9b1d1b3
Compare
je-cook
approved these changes
Apr 20, 2026
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 two new parameters describing the toroidal field (TF) coil's geometry at the midplane—
dr_tf_full_midplaneanddr_tf_internal_midplane—and refactors the code to use a dataclass (TFGlobalGeometry) for returning TF coil geometry. It updates the calculation, storage, output, and plotting of these new parameters, and adapts related tests accordingly.TF coil geometry calculation and data structure refactor:
TFGlobalGeometrydataclass inprocess/models/tfcoil/base.pyto encapsulate all global TF coil geometry parameters, replacing the previous tuple return value fromtf_global_geometry. The dataclass now includes the newdr_tf_full_midplaneanddr_tf_internal_midplanefields.run_base_tfto use the new dataclass and assign its fields to the appropriate variables.New TF coil midplane width parameters:
dr_tf_full_midplaneanddr_tf_internal_midplanetoprocess/data_structure/tfcoil_variables.py, with initialization and docstrings, and ensured they are initialized ininit_tfcoil_variables.tf_global_geometryas the full external and internal coil widths at the midplane.Output and plotting updates:
outtf) to write the new parameters to output files.process/core/io/plot/summary.pyto use the new parameters for midplane width annotations.Test updates:
tests/unit/models/tfcoil/test_tfcoil.pyto check the new parameters, use the dataclass, and compare results usingastuple.Checklist
I confirm that I have completed the following checks: