4269 inconsistent use of eps variable in functions#4282
Open
chris-ashe wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes how inverse aspect ratio (eps) is handled across plasma current / field calculations by deriving it from aspect where appropriate, and aligns naming (ip → cur_plasma) to reduce ambiguity in physics routines.
Changes:
- Remove explicit
epsarguments from Peng-related calculations and computeeps = 1 / aspectinternally. - Rename plasma current parameter from
iptocur_plasmain the surface-averaged poloidal field calculation and its call sites. - Reformat reference sections in docstrings for consistency.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/unit/models/physics/test_physics.py |
Updates unit tests to match revised function signatures/inputs and expected numeric outputs. |
process/models/physics/plasma_fields.py |
Adjusts surface-averaged poloidal field API (cur_plasma, derive eps) and uses PlasmaCurrentModel enum for model selection. |
process/models/physics/plasma_current.py |
Updates Peng scaling to derive eps from aspect, removes the older poloidal-field helper, and switches several calls to keyword arguments for clarity. |
process/models/physics/physics.py |
Updates the physics model to call the revised poloidal-field routine with cur_plasma and without eps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
321
to
331
| # Peng scaling for double null divertor; TARTs [STAR Code] | ||
| elif model == PlasmaCurrentModel.PENG_DIVERTOR_SCALING: | ||
| plasma_current = 1.0e6 * self.calculate_plasma_current_peng( | ||
| q95, | ||
| aspect_ratio, | ||
| eps, | ||
| rminor, | ||
| b_plasma_toroidal_on_axis, | ||
| kappa, | ||
| triang, | ||
| q95=q95, | ||
| aspect=aspect_ratio, | ||
| eps=eps, | ||
| rminor=rminor, | ||
| b_plasma_toroidal_on_axis=b_plasma_toroidal_on_axis, | ||
| kappa=kappa, | ||
| triang=triang, | ||
| ) |
Comment on lines
3818
to
3824
| result = physics.fields.calculate_surface_averaged_poloidal_field( | ||
| i_plasma_current, | ||
| c_plasma, | ||
| q95, | ||
| b_plasma_toroidal_on_axis, | ||
| aspect, | ||
| eps, | ||
| kappa, |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4282 +/- ##
=======================================
Coverage 48.81% 48.81%
=======================================
Files 151 151
Lines 29097 29091 -6
=======================================
- Hits 14203 14202 -1
+ Misses 14894 14889 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7b1cfda to
177d4a5
Compare
…s variable and update parameter names for clarity
177d4a5 to
4066e1d
Compare
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.
Description
Checklist
I confirm that I have completed the following checks: