镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add plasma compositions by particle number and mass - #4741

Open
chris-ashe wants to merge 7 commits into
mainfrom
add_impurity_masses
Open

chris-ashe wants to merge 7 commits into
mainfrom
add_impurity_masses

Conversation

@chris-ashe

@chris-ashe chris-ashe commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

This pull request adds comprehensive tracking and visualization of plasma composition by both particle number and mass, including detailed support for impurity species. It introduces new data fields, calculations, output reporting, and plotting functions to provide a clearer and more complete picture of plasma constituents in both the core model and its outputs.

Enhancements to plasma composition tracking and reporting:

  • Added new fields to PhysicsData for the mass and number of all major plasma species (deuterons, tritons, helions, alpha particles, electrons) as well as a wide set of impurity ions (e.g., beryllium, carbon, oxygen, etc.), enabling fine-grained tracking of plasma constituents.
  • Implemented calculations in DetailedPhysics for the mass and number of each plasma species and impurity, updating these values during model execution.
  • Expanded the output routine to report the mass and particle count for each plasma species and impurity, improving the transparency and detail of simulation results.

Visualization improvements:

  • Added two new plotting functions, plot_plasma_composition_bar and plot_plasma_mass_composition_bar, to visualize the plasma composition by particle number and mass, respectively, including impurity species. These are now integrated into the summary plotting API and summary page layout.
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 requested a review from a team as a code owner November 10, 2026 14:34
@chris-ashe chris-ashe added Physics Relating to the physics models Plotting labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown

⚠️ improve_quality_job warning!

Files changed by this PR have introduced 1 more linting errors when compared to main

Please fix these

To check what these are, run hatch run lint:fmt_extra on your branch and on main

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.32298% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.46%. Comparing base (d1a7687) to head (d9b73a2).

Files with missing lines Patch % Lines
process/core/io/plot/summary/plasma/physics.py 4.54% 42 Missing ⚠️
process/models/physics/physics.py 85.71% 6 Missing ⚠️
process/core/io/plot/summary/api.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4741      +/-   ##
==========================================
+ Coverage   50.94%   51.46%   +0.52%     
==========================================
  Files         181      181              
  Lines       30406    30559     +153     
==========================================
+ Hits        15490    15728     +238     
+ Misses      14916    14831      -85     

☔ View full report in Codecov by Harness.
📢 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.

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 Plotting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants