8000 ♻️ Write current profile, inductance and normalised beta relations as functions by chris-ashe · Pull Request #3655 · ukaea/PROCESS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

♻️ Write current profile, inductance and normalised beta relations as functions #3655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy stateme 8000 nt. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 13, 2025

Conversation

chris-ashe
Copy link
Collaborator
@chris-ashe chris-ashe commented May 6, 2025

Code Enhancements and Refactoring:

  • Refactored process/physics.py to improve readability by grouping related calculations into distinct sections with clear headers. For example, sections for "Plasma Current Profile" and "Normalized Beta Limit" were added.
  • Introduced new static methods in Physics class for calculating Wesson, Menard, and Tholerus scaling laws for normalized beta and internal inductance. These methods encapsulate specific calculation logic, improving modularity and maintainability.

Documentation Updates:

  • Updated descriptions in plasma_beta.md and plasma_inductance.md to provide additional context for the Wesson and Menard models, including their recommended usage and data sources.

Unit Tests:

  • Added comprehensive unit tests in tests/unit/test_physics.py for new methods, ensuring correctness of calculations for normalized beta and internal inductance models.

Minor Changes:

  • Adjusted comment formatting and added headers in physics.py for better code clarity.

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@chris-ashe chris-ashe added Physics Relating to the physics models Refactor labels May 6, 2025
@chris-ashe chris-ashe self-assigned this May 6, 2025
@codecov-commenter
Copy link
codecov-commenter commented May 6, 2025

Codecov Report

Attention: Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.

Project coverage is 36.42%. Comparing base (b5572eb) to head (f373766).

Files with missing lines Patch % Lines
process/physics.py 80.76% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3655      +/-   ##
==========================================
+ Coverage   36.36%   36.42%   +0.06%     
==========================================
  Files          88       88              
  Lines       22108    22129      +21     
==========================================
+ Hits         8039     8060      +21     
  Misses      14069    14069              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chris-ashe chris-ashe requested a review from j-a-foster May 6, 2025 10:50
@chris-ashe chris-ashe marked this pull request as ready for review May 6, 2025 12:38
Copy link
Collaborator
@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with the new functions, code changes, and docs.

@chris-ashe chris-ashe merged commit a7a9687 into main May 13, 2025
18 checks passed
@chris-ashe chris-ashe deleted the add_func_for_betan_alphaj_ind branch May 13, 2025 12:29
ym1906 pushed a commit that referenced this pull request May 16, 2025
… functions (#3655)

* ♻️ ✅ Add function for wesson current profile relation and add unit test

* ✨ Add Wesson internal inductance calculation and corresponding unit test

* ✨ Add Menard plasma internal inductance calculation and corresponding unit test

* ✨ Add Wesson normalized beta limit calculation and corresponding unit test

* ✨ Add calculate_beta_norm_max_original method and corresponding unit test

* ✨ Add Menard normalized beta calculation method and corresponding unit test

* ✨ Add E. Tholerus normalized beta upper limit calculation method and corresponding unit test
ym1906 pushed a commit that referenced this pull request May 16, 2025
… functions (#3655)

* ♻️ ✅ Add function for wesson current profile relation and add unit test

* ✨ Add Wesson internal inductance calculation and corresponding unit test

* ✨ Add Menard plasma internal inductance calculation and corresponding unit test

* ✨ Add Wesson normalized beta limit calculation and corresponding unit test

* ✨ Add calculate_beta_norm_max_original method and corresponding unit test

* ✨ Add Menard normalized beta calculation method and corresponding unit test

* ✨ Add E. Tholerus normalized beta upper limit calculation method and corresponding unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Physics Relating to the physics models Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0