Skip to content

🎨 Plot sauter bootstrap profile#3976

Merged
clmould merged 6 commits intomainfrom
plot_sauter_bootstrap_profile
Dec 5, 2025
Merged

🎨 Plot sauter bootstrap profile#3976
clmould merged 6 commits intomainfrom
plot_sauter_bootstrap_profile

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

@chris-ashe chris-ashe commented Nov 6, 2025

This pull request adds support for storing, processing, and visualizing the Sauter bootstrap current density profile in the plasma physics workflow. The changes introduce a new variable to hold the bootstrap profile, compute and store it during physics calculations, output it for further use, and update the plotting routines to display the profile for analysis.

Support for Sauter bootstrap current density profile:

  • Added a new variable j_plasma_bootstrap_sauter_profile to physics_variables.py to store the Sauter bootstrap current density profile, with initialization and global declaration updates.
  • In physics.py, updated the bootstrap_fraction_sauter function to compute and assign the Sauter bootstrap current density profile to j_plasma_bootstrap_sauter_profile using numpy gradients for improved numerical stability.
  • Output the computed Sauter bootstrap current density profile at each profile point to the output file for downstream use.

Visualization improvements:

  • Updated the plot_jprofile function in plot_proc.py to accept the new profile data, plot the Sauter bootstrap current density profile alongside the existing current density, and add a legend and annotation for clarity.
    Technical and numerical fixes:

  • Replaced manual partial derivative calculations with numpy.gradient for more robust and accurate computation of profile gradients in the Sauter bootstrap calculation.

  • Minor refactoring to remove unused or redundant variables and checks in the bootstrap calculation for code clarity.

image

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 self-assigned this Nov 6, 2025
@chris-ashe chris-ashe added Physics Relating to the physics models Input/Output Files Issues related to the input and output data files labels Nov 6, 2025
@chris-ashe chris-ashe changed the title Plot sauter bootstrap profile 🎨 Plot sauter bootstrap profile Nov 6, 2025
@chris-ashe chris-ashe marked this pull request as ready for review November 11, 2025 08:56
@chris-ashe chris-ashe marked this pull request as draft November 11, 2025 09:01
@chris-ashe chris-ashe force-pushed the plot_sauter_bootstrap_profile branch from 5bd1dc9 to 7c5178e Compare November 14, 2025 14:03
@chris-ashe chris-ashe marked this pull request as ready for review November 14, 2025 14:11
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.87%. Comparing base (aa129eb) to head (fe94e80).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
process/io/plot_proc.py 14.28% 6 Missing ⚠️
process/physics.py 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3976      +/-   ##
==========================================
- Coverage   46.04%   45.87%   -0.18%     
==========================================
  Files         123      123              
  Lines       28962    30081    +1119     
==========================================
+ Hits        13336    13800     +464     
- Misses      15626    16281     +655     

☔ 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 review from clmould and removed request for timothy-nunn November 19, 2025 10:57
@chris-ashe chris-ashe force-pushed the plot_sauter_bootstrap_profile branch from 512fa38 to 5ff48ff Compare November 19, 2025 14:38
Comment thread process/physics.py Outdated
Comment thread process/physics.py
Comment thread process/physics.py Outdated
Comment thread process/physics.py
Copy link
Copy Markdown
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 changes to plot proc plot.

@chris-ashe chris-ashe force-pushed the plot_sauter_bootstrap_profile branch from a1ad6af to fe94e80 Compare December 2, 2025 09:29
@clmould clmould merged commit 1448faf into main Dec 5, 2025
14 of 18 checks passed
@clmould clmould deleted the plot_sauter_bootstrap_profile branch December 5, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input/Output Files Issues related to the input and output data files New Variables Physics Relating to the physics models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants