Skip to content

Reinstate image comparison tests#27

Open
AdamOrmondroyd wants to merge 18 commits into
masterfrom
reinstatetests
Open

Reinstate image comparison tests#27
AdamOrmondroyd wants to merge 18 commits into
masterfrom
reinstatetests

Conversation

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator

@AdamOrmondroyd AdamOrmondroyd commented Feb 9, 2025

Description

Spotted #6, so have reinstated the tests. Since then, it seems the $3.5\sigma$ contour doesn't plot any more, and the style of the line plots is a bit different. Comparison below:

Old

Screenshot 2025-02-09 at 15 16 14

New

Screenshot 2025-02-09 at 15 16 34

I realised that the "no_ax" tests should output the same as their "fig, ax = plt.subplots()" counterparts, so they use the same images for comparison

Fixes #6

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • I compared each of the old plots with their new versions, to verify that the updates are sane.

Test Configuration:

  • Firmware version: macOS Sequoia 15.3
  • Hardware: M1 pro macbook pro
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.50%. Comparing base (278a148) to head (92600f0).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (278a148) and HEAD (92600f0). Click for more details.

HEAD has 24 uploads less than BASE
Flag BASE (278a148) HEAD (92600f0)
36 12
Additional details and impacted files
@@             Coverage Diff             @@
##            master      #27      +/-   ##
===========================================
- Coverage   100.00%   94.50%   -5.50%     
===========================================
  Files           17       17              
  Lines          844      855      +11     
===========================================
- Hits           844      808      -36     
- Misses           0       47      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

I'm confused why the tests are now showing as uncovered

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

@williamjameshandley rolling back codecov has fixed it 🥲

Copy link
Copy Markdown
Collaborator

@williamjameshandley williamjameshandley left a comment

Choose a reason for hiding this comment

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

Many thanks @AdamOrmondroyd

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

you're happy to roll back codecov?

@williamjameshandley
Copy link
Copy Markdown
Collaborator

Yes.

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

Ah - the tests are skipping in the CI! Codecov V4 was doing its job
Screenshot_20250220_233501_Chrome

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

AdamOrmondroyd commented Feb 21, 2025

Disappointed, but not surprised

AdamOrmondroyd and others added 3 commits May 12, 2026 17:03
The decorator pointed at plot_transparent instead of plot_fineness, and
the plot_fineness.pdf baseline was the wrong page size (6.4x4.8" vs the
8x6" all other baselines use), so even fixing the decorator would have
failed an image-size check. Regenerated from a fresh local run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…_figures_equal for no_ax tests

Set tol=5 on image_comparison decorators: macOS-generated PDF baselines
rasterise slightly differently under Linux ghostscript (observed RMS
~1.3-1.5 on Ubuntu CI). tol=5 absorbs the platform jitter while staying
well below real visual regressions.

Swap test_plot_no_ax and test_plot_lines_no_ax to check_figures_equal:
they're equivalence assertions ("default ax behaves like explicit ax"),
not visual-baseline checks, so they don't need stored baselines and
sidestep platform drift entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

AdamOrmondroyd commented May 12, 2026

Had to go gentle on the tolerances to get the tests to pass 😢

@AdamOrmondroyd
Copy link
Copy Markdown
Collaborator Author

I think that's as good as we're going to get

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.

Reinstate image comparison tests

2 participants