Skip to content

Refactor some of the plotting code#181

Merged
samaloney merged 11 commits intoTCDSolar:mainfrom
samaloney:feat-ploting-tidy
Nov 6, 2025
Merged

Refactor some of the plotting code#181
samaloney merged 11 commits intoTCDSolar:mainfrom
samaloney:feat-ploting-tidy

Conversation

@samaloney
Copy link
Copy Markdown
Member

@samaloney samaloney commented Sep 2, 2025

Refactor to move plotting code out of products to simplify and try to keep single reponssiblty principle a bit more closes #180.

  • Created new PixelPlotter class
  • Refactored current mixin to use this new class
    • can prob remove the mixin to simplify even further
  • Allows the PixelPlots to be animated which was part of the motivation
test2.mp4

@samaloney samaloney requested review from Copilot and nicHoch September 2, 2025 14:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 77.40864% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.36%. Comparing base (ea35d6f) to head (8241045).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
stixpy/visualisation/plotters.py 77.05% 67 Missing ⚠️
stixpy/product/sources/science.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   80.97%   81.36%   +0.39%     
==========================================
  Files          35       36       +1     
  Lines        2391     2458      +67     
==========================================
+ Hits         1936     2000      +64     
- Misses        455      458       +3     

☔ 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
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the plotting code by extracting pixel plotting functionality from the PixelPlotMixin class into a new dedicated PixelPlotter class to improve code organization and follow the single responsibility principle.

  • Creates a new PixelPlotter class that handles all pixel plotting logic
  • Simplifies the PixelPlotMixin by delegating to the new plotter class
  • Enables animation capabilities for pixel plots through the cleaner separation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
stixpy/visualisation/plotters.py New file containing the extracted PixelPlotter class and SliderCustomValue helper
stixpy/product/sources/science.py Refactored to use the new PixelPlotter class and removed extensive plotting code

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread stixpy/product/sources/science.py Outdated
Comment thread stixpy/visualisation/plotters.py
Comment thread stixpy/visualisation/plotters.py Outdated
Comment thread stixpy/visualisation/plotters.py
Comment thread stixpy/visualisation/plotters.py
@samaloney samaloney force-pushed the feat-ploting-tidy branch 2 times, most recently from ddd3653 to ad0de9c Compare September 4, 2025 10:40
@samaloney samaloney marked this pull request as ready for review September 4, 2025 14:48
Copy link
Copy Markdown
Contributor

@nicHoch nicHoch left a comment

Choose a reason for hiding this comment

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

good rework - better structure now for more plotting to come

@samaloney samaloney merged commit 3c8b7d6 into TCDSolar:main Nov 6, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract pixel plot code to its own class and call from plot_pixels

3 participants