Conversation
7a93ce1 to
20e44af
Compare
20e44af to
ce7c700
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4053 +/- ##
==========================================
- Coverage 46.49% 45.72% -0.77%
==========================================
Files 123 124 +1
Lines 28777 31990 +3213
==========================================
+ Hits 13381 14629 +1248
- Misses 15396 17361 +1965 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3057b2c to
0d66af1
Compare
… redundant function from physics_functions.py
0d66af1 to
108a973
Compare
…ndant function from physics.py
00a9ee6 to
ec47444
Compare
…d remove redundant function
…or improved maintainability
| @staticmethod | ||
| def calculate_beta_limit_from_norm( |
There was a problem hiding this comment.
What is the speed impact of no longer JIT compiling this method?
There was a problem hiding this comment.
Can you move the calculations that are not depended on into the new Beta class and add run and output methods to this class.
That way in the caller we can do models.beta.run() (or models.beta.output()) which will run the Beta model (and output if appropriate). Some of the variables will need a bit of untangling (e.g. beta_poloidal_vol_avg which is used later on in physics to calculate f_c_plasma_bootstrap_sakai) but this can be done in a later PR.
…d and improve error handling
…esson, Original Scaling, Menard, Tholerus, and Stambaugh relations
…variable formatting
…roved organization and maintainability
bdebe55 to
c75741c
Compare
This pull request introduces a new
PlasmaBetaclass to centralize and standardize plasma beta calculations across the codebase. The changes refactor existing code to use this class, update dependencies, and add new unit tests for its methods. The most important changes are grouped below:Core Refactoring and Architecture:
Added a new
PlasmaBetaclass toprocess.physicsand refactored the codebase to use this class for all plasma beta-related calculations, replacing previous standalone functions.Updated the initialization of major classes (
main.py,stellarator.py) to instantiate and passPlasmaBetaobjects where needed, ensuring consistent access to beta calculations throughout the application.Code Cleanup and Removal:
Removed the now-obsolete
fast_alpha_betafunction fromprocess/physics_functions.py, migrating its logic to the newPlasmaBetaclass.Updated all usages of beta calculation functions to use the new class methods, including replacing calls in the
Stellaratormodel.Testing and Validation:
test_physics.pyandtest_stellarator.pyto use the newPlasmaBetaclass and its methods, ensuring all previous tests remain valid and comprehensive.PlasmaBetamethods, such ascalculate_normalised_betaandcalculate_plasma_energy_from_beta, to improve coverage and reliability.Dependency and Import Updates:
PlasmaBetaclass.These changes improve maintainability by centralizing plasma beta logic, reduce code duplication, and enhance test coverage.## Description
Checklist
I confirm that I have completed the following checks: