4269 inconsistent use of eps variable in functions - #4282
Conversation
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.
| # 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, | ||
| ) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4282 +/- ##
==========================================
- Coverage 48.81% 48.69% -0.12%
==========================================
Files 151 151
Lines 29097 29290 +193
==========================================
+ Hits 14203 14263 +60
- Misses 14894 15027 +133 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7b1cfda to
177d4a5
Compare
…s variable and update parameter names for clarity
177d4a5 to
4066e1d
Compare
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
…ariable names and improve clarity
75a7a11 to
4f61407
Compare
clmould
left a comment
There was a problem hiding this comment.
Just 1 small change but all good otherwise
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Description
Checklist
I confirm that I have completed the following checks: