Update lablcc labels#4266
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the human-readable constraint labels (lablcc) and a few constraint registration/docstring strings to use clearer terminology and more standard fusion-physics notation (subscripts, angle brackets, etc.) in PROCESS’s constraint reporting/output.
Changes:
- Refreshed
process/data_structure/numerics.py:lablccstrings to more descriptive/symbolic labels. - Updated constraint registration strings in
process/core/solver/constraints.py(e.g., volt-second unit label) and tweaked some docstring text/notation. - Simplified constraint 51’s implementation to use
vs_plasma_ramp_requireddirectly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
process/data_structure/numerics.py |
Updates the lablcc constraint label list to newer, more descriptive/symbolic names. |
process/core/solver/constraints.py |
Adjusts selected constraint registration strings and docstrings (including volt-second unit labeling) and refactors constraint 51 to use vs_plasma_ramp_required. |
Comments suppressed due to low confidence (1)
process/data_structure/numerics.py:599
- Constraints 69–71 are not registered in
process/core/solver/constraints.py(the registry jumps from 68 to 72), butlablccstill provides labels for them (with# REMOVED). Consider using a consistent placeholder like "NOT USED"/blank here to reflect that these IDs are intentionally unavailable, and to reduce confusion when reading constraint listings.
"p_sep < psep_kallenbach divertor ", # REMOVED
"Separatrix temp consistency ", # REMOVED
"Separatrix density consistency ", # REMOVED
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "Vessel helium concentration limit", # REMOVED | ||
| "Pₛₑₚ / R₀ upper limit ", | ||
| "TF coil leg rad width lower limit", # REMOVED | ||
| "TF coil leg rad width lower limit", # REMOVED |
| @ConstraintManager.register_constraint(51, "V.s", "=") | ||
| def constraint_equation_51(constraint_registration, data): | ||
| """Equation to enforce startup flux = available startup flux | ||
|
|
||
| vs_plasma_res_ramp: resistive losses in startup V-s (Wb) | ||
| vs_plasma_ind_ramp: internal and external plasma inductance V-s (Wb)) | ||
| vs_plasma_ramp_required: Required flux swing for startup (Wb) | ||
| vs_cs_pf_total_ramp: total flux swing for startup (Wb) | ||
| """ | ||
| return eq( | ||
| abs( | ||
| data_structure.physics_variables.vs_plasma_res_ramp | ||
| + data_structure.physics_variables.vs_plasma_ind_ramp | ||
| ), | ||
| abs(data_structure.physics_variables.vs_plasma_ramp_required), | ||
| data.pf_coil.vs_cs_pf_total_ramp, |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4266 +/- ##
==========================================
+ Coverage 50.13% 50.14% +0.01%
==========================================
Files 151 151
Lines 29343 29355 +12
==========================================
+ Hits 14710 14719 +9
- Misses 14633 14636 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Checklist
I confirm that I have completed the following checks: