Skip to content

Full poloidal cross-section#4136

Open
chris-ashe wants to merge 6 commits intomainfrom
fill_poloidal_corss_section
Open

Full poloidal cross-section#4136
chris-ashe wants to merge 6 commits intomainfrom
fill_poloidal_corss_section

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Mar 22, 2026

This pull request adds support for mirroring the poloidal cross-section plots of various tokamak components to the negative x-axis, enabling full machine symmetry in visualizations. This is achieved by introducing a mirror_negative_x parameter to the relevant plotting functions and applying a transformation to the x-coordinates when this option is enabled. Additionally, a new convenience function is added to plot the full machine cross-section including all mirrored components.

Major changes:

Mirroring support for plotting functions

  • Added a mirror_negative_x boolean parameter (default False) to the following functions: plot_plasma, plot_centre_cross, plot_vacuum_vessel_and_divertor, plot_shield, plot_blanket, plot_firstwall, and plot_cryostat. When enabled, these functions now mirror the plot to the negative x-axis by multiplying x-coordinates by -1.

  • Updated the implementation of these plotting functions to apply the x-axis mirroring transformation (x_scale) wherever x-coordinates are used, ensuring all plotted elements are correctly mirrored when requested.

New full cross-section plotting function

  • Added a new function plot_full_machine_poloidal_cross_section that plots the entire machine cross-section, including all major components (vessel, shield, blanket, first wall, plasma, coils, cryostat, etc.) and their mirrored counterparts, using the updated plotting functions with the mirror_negative_x flag.
image

Documentation improvements

  • Updated the docstrings of all affected functions to document the new mirror_negative_x parameter and its effect.

These changes enhance the flexibility and completeness of the plotting utilities, making it easier to visualize the full symmetric geometry of the machine for analysis and presentations.## Description

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.

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 5.40541% with 70 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.78%. Comparing base (c9a2074) to head (3afb342).

Files with missing lines Patch % Lines
process/core/io/plot_proc.py 5.40% 70 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4136      +/-   ##
==========================================
- Coverage   47.84%   47.78%   -0.06%     
==========================================
  Files         141      141              
  Lines       29754    29791      +37     
==========================================
+ Hits        14236    14237       +1     
- Misses      15518    15554      +36     

☔ 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 marked this pull request as ready for review March 23, 2026 09:00
@chris-ashe chris-ashe requested a review from a team as a code owner March 23, 2026 09:00
@chris-ashe chris-ashe requested a review from j-a-foster March 23, 2026 09:00
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 changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants