Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Jan 29, 2026

This pull request refactors the logic for handling stacked plots in the main function of process/io/plot_scans.py. The main improvement is to ensure that subplots for stacked plots are created only once, and only when needed, thereby fixing potential issues with subplot creation and improving code clarity.

Plotting logic improvements:

  • Moved the creation of subplots for stacked plots (fig, axs = plt.subplots(...)) from the outer loop to occur only once, at the first relevant iteration, preventing redundant subplot creation and related errors.
  • Removed the previous subplot creation block from the outer loop and replaced it with a pass statement, since subplot creation is now handled inside the plotting logic.
  • Added a check to raise a ValueError if stacked plots are requested with only one output variable, ensuring proper usage and error handling.…iables are handled correctly

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.

@chris-ashe chris-ashe self-assigned this Jan 29, 2026
@chris-ashe chris-ashe requested a review from a team as a code owner January 29, 2026 10:25
@chris-ashe chris-ashe added the Bug Something isnt working label Jan 29, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.60%. Comparing base (e06c522) to head (3ea0f5d).

Files with missing lines Patch % Lines
process/io/plot_scans.py 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4068      +/-   ##
==========================================
- Coverage   46.60%   46.60%   -0.01%     
==========================================
  Files         122      122              
  Lines       28711    28713       +2     
==========================================
  Hits        13381    13381              
- Misses      15330    15332       +2     

☔ 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

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

Can you give me an example of the bug this fixes please (an MFile + commands to run)... its not immediately obvious what the problem was and how this fixes it.

sharex=True,
)
fig.subplots_adjust(hspace=0.0)
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rewrite this if statement to avoid just having a pass

@timothy-nunn timothy-nunn self-assigned this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isnt working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants