Refactor L-H transition calculations and integrate into Physics model#4123
Open
chris-ashe wants to merge 6 commits intomainfrom
Open
Refactor L-H transition calculations and integrate into Physics model#4123chris-ashe wants to merge 6 commits intomainfrom
chris-ashe wants to merge 6 commits intomainfrom
Conversation
- Removed direct function calls for L-H transition calculations and encapsulated them within the PlasmaConfinementTransition class. - Updated the Physics class to utilize the new PlasmaConfinementTransition instance for L-H power threshold calculations. - Modified unit tests to instantiate PlasmaConfinementTransition and validate its methods. - Cleaned up unused L-H transition functions from the physics module.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4123 +/- ##
==========================================
+ Coverage 47.51% 47.61% +0.10%
==========================================
Files 141 141
Lines 29487 29557 +70
==========================================
+ Hits 14010 14073 +63
- Misses 15477 15484 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…entTransition references
timothy-nunn
requested changes
Mar 6, 2026
Collaborator
timothy-nunn
left a comment
There was a problem hiding this comment.
Before I give this a review can you fix the integration tests that are failing.
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 improves the clarity and maintainability of the L-H transition (plasma confinement transition) model in both the documentation and the codebase. The main updates include refactoring the code to use the
PlasmaConfinementTransitionclass, updating documentation to reference specific calculation methods, improving plotting output, and updating tests to use the new class-based interface.Documentation Improvements:
Updated
plasma_h_mode.mdto reference thePlasmaConfinementTransitionclass and specific calculation methods for each L-H threshold scaling, making the documentation clearer and directly linked to the code implementation.Improved equation formatting by replacing
\mathtt{}with\texttt{}for code-style math, enhancing consistency.Code Refactoring and Integration:
Refactored code to use the
PlasmaConfinementTransitionclass (and its model enum) throughout the codebase, improving encapsulation and maintainability. This includes updates inmain.pyandplot_proc.pyto use the new class for L-H threshold calculations and display.Enhanced the plasma information plot to display the full L-H threshold model name, with line wrapping for long names, making the output more user-friendly.
Minor formatting improvements in plot labels for better readability.
Testing Updates:
PlasmaConfinementTransitionclass methods instead of standalone functions, ensuring tests are aligned with the new code structure and improving test clarity.Description
Checklist
I confirm that I have completed the following checks: