Skip to content

Add Solov'ev equilibria#4114

Open
chris-ashe wants to merge 2 commits intomainfrom
solovev_equilibrium
Open

Add Solov'ev equilibria#4114
chris-ashe wants to merge 2 commits intomainfrom
solovev_equilibrium

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Feb 26, 2026

This pull request expands the plotting functionality in process/io/plot_proc.py by adding a new analytic equilibrium plot and updating the figure indexing throughout the main plotting routine to accommodate the additional plot. The changes ensure all plots are correctly assigned to their respective figure pages and axes.

New analytic equilibrium plot:

  • Added import for plot_analytic_equilibrium from process.models.physics.solovev_equilibrium and integrated its plotting into the main plotting routine, providing visualization of the analytic equilibrium. [1] [2]

Plot indexing and figure allocation updates:

  • Incremented the figure count from 30 to 31 in the main function to accommodate the new plot.
  • Updated subplot and figure indices throughout the main_plot function to ensure each plot is placed on the correct page and axis, maintaining layout consistency after the addition of the new plot.
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 added Physics Relating to the physics models Plotting labels Feb 26, 2026
@chris-ashe chris-ashe mentioned this pull request Feb 26, 2026
6 tasks
@chris-ashe chris-ashe requested a review from ajpearcey February 26, 2026 10:01
@chris-ashe chris-ashe marked this pull request as ready for review February 26, 2026 10:01
@chris-ashe chris-ashe requested a review from a team as a code owner February 26, 2026 10:01
@chris-ashe chris-ashe changed the title Create new branch for Solovev Add Solov'ev equilibria Feb 26, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 14.13534% with 571 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.19%. Comparing base (4741c15) to head (7435ed6).

Files with missing lines Patch % Lines
process/models/physics/solovev_equilibrium.py 14.57% 545 Missing ⚠️
process/io/plot_proc.py 3.70% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4114      +/-   ##
==========================================
- Coverage   46.88%   46.19%   -0.70%     
==========================================
  Files         136      137       +1     
  Lines       29253    29895     +642     
==========================================
+ Hits        13715    13809      +94     
- Misses      15538    16086     +548     

☔ 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.

Copy link
Collaborator

@je-cook je-cook left a comment

Choose a reason for hiding this comment

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

I think a lot of this can be done far more concisely. Being this long makes is much harder to follow. My estimate is <1000 lines.

Please use dataclasses where appropriate and include less in the overall class.
I would also guess that most of the methods are not individually useful to a user. Please have a think about what is a useful API to expose to the user in the classes and only make methods for that


for i, psi_norm in enumerate(psi_norm_mesh):
# Use this instead of matplotlib.contour as the latter forces figure creation.
contour = measure.find_contours(psi_bar_norm_grid, level=psi_norm)
Copy link
Collaborator

@je-cook je-cook Feb 26, 2026

Choose a reason for hiding this comment

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

just use contourpy directly, then we dont need the new dependency as it already comes with mpl

@je-cook je-cook self-assigned this Feb 26, 2026
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.

3 participants