Skip to content
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 statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new suite of bootstrap current scalings #3355

Merged

Conversation

chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Oct 22, 2024

This pull request includes several updates to the documentation and codebase, primarily focusing on the addition of new bootstrap current scaling methods and improvements to plotting functions.

Documentation Updates:

  • Added descriptions and formulas for new bootstrap current scaling methods: ARIES, Andrade, Hoang, Wong, and Gi Scalings.
  • Updated references to include citations for the new scaling methods.

Codebase Improvements:

  • Modified plotting functions to use axis-specific methods instead of plt methods for better encapsulation.
  • Added a new function plot_bootstrap_comparison to generate a comparison plot of bootstrap current fractions using various scaling methods.
  • Updated the main_plot and main functions to include the new bootstrap comparison plot.
  • Fixed a typo in the main_plot function comment.

Plasma Profiles:

  • Added calculation for volume-averaged pressure assuming a parabolic profile in calculate_profile_factors.This pull request includes significant updates to the documentation and codebase, particularly focusing on the bootstrap current models and plotting functions. The most important changes include the addition of new bootstrap current scaling methods, updates to the plotting functions to use axis objects, and enhancements to the documentation.

Documentation Updates:

  • Added new bootstrap current scaling methods (ARIES, Andrade, Hoang, Wong, Gi) and their descriptions in bootstrap_current.md.
  • Included new references for the added bootstrap current scaling methods.

Codebase Enhancements:

  • Updated the plot_proc.py to use axis objects instead of plt for plotting functions.
  • Added a new plotting function plot_bootstrap_comparison to visualize bootstrap current fractions.

image

  • Modified main_plot and main functions to include the new bootstrap comparison plot.

Physics Calculations:

  • Integrated new bootstrap current scaling methods into the physics function.
  • Added output variables for plasma pressure and pressure profile index in the outplas function.

Minor Fixes:

  • Corrected variable name from plasma_current_MA to plasma_current_ma in plot_proc.py.
  • Imported scipy in physics.py to support new calculations.

Checklist

I confirm that I have completed the following checks:

  • 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 Bootstrap Current Bootstrap current generated by the plasma labels Oct 22, 2024
@chris-ashe chris-ashe linked an issue Oct 22, 2024 that may be closed by this pull request
@chris-ashe chris-ashe changed the title Implement new suite of bootstrap current scalings 🚧 Implement new suite of bootstrap current scalings Oct 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 25.61983% with 90 lines in your changes missing coverage. Please review.

Project coverage is 27.13%. Comparing base (42780a9) to head (75ffc9c).

Files with missing lines Patch % Lines
process/io/plot_proc.py 1.92% 51 Missing ⚠️
process/physics.py 42.64% 39 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3355      +/-   ##
==========================================
+ Coverage   27.11%   27.13%   +0.01%     
==========================================
  Files          77       77              
  Lines       17816    17921     +105     
==========================================
+ Hits         4831     4862      +31     
- Misses      12985    13059      +74     

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

- Add calculation of volume averaged pressure in plasma_profiles.md. This also add the core pressure and volume averaged pressure to the output. Assuming a parabolic profile
- Implement bootstrap fraction calculation using Andrade et al formula in physics.py. This is currently implemented and exported with no tests and notes of applicability regimes
- Add calculation of volume averaged pressure in plasma_profiles.md. This also add the core pressure and volume averaged pressure to the output. Assuming a parabolic profile
- Implement bootstrap fraction calculation using Andrade et al formula in physics.py. This is currently implemented and exported with no tests and notes of applicability regimes
@chris-ashe chris-ashe force-pushed the 3344-implement-suite-of-new-bootstrap-current-scalings branch from 54c4cb3 to 9e57e4c Compare October 24, 2024 09:43
@chris-ashe chris-ashe marked this pull request as ready for review November 7, 2024 10:21
@chris-ashe chris-ashe changed the title 🚧 Implement new suite of bootstrap current scalings Implement new suite of bootstrap current scalings Nov 7, 2024
@chris-ashe chris-ashe self-assigned this Nov 7, 2024
Copy link
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

Had a look at the docs files and plot_proc, there are some changes throughout

process/io/plot_proc.py Outdated Show resolved Hide resolved
process/io/plot_proc.py Outdated Show resolved Hide resolved
process/io/plot_proc.py Outdated Show resolved Hide resolved
process/io/plot_proc.py Outdated Show resolved Hide resolved
process/io/plot_proc.py Outdated Show resolved Hide resolved
@chris-ashe
Copy link
Collaborator Author

@kj5248 Changes pushed, please check again

jonmaddock and others added 2 commits November 8, 2024 14:20
Covered in CITATION.cff and README.md.
* allow process version to be printed to terminal

* add version monkeypatch to test_run_mode
@chris-ashe chris-ashe force-pushed the 3344-implement-suite-of-new-bootstrap-current-scalings branch from 7757b49 to 9baa160 Compare November 8, 2024 14:25
Copy link
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

Single thing, otherwise I believe it is all good

process/physics.py Outdated Show resolved Hide resolved
Copy link
Contributor

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

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

Just one comment regarding profile assumptions. Feel free to merge if you dont think its a problem.

process/physics.py Show resolved Hide resolved
@timothy-nunn timothy-nunn merged commit a800baf into main Nov 13, 2024
14 of 18 checks passed
@timothy-nunn timothy-nunn deleted the 3344-implement-suite-of-new-bootstrap-current-scalings branch November 13, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bootstrap Current Bootstrap current generated by the plasma Physics Relating to the physics models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement suite of new bootstrap current scalings
6 participants