Skip to content

fix: ci's and scanpy 1.13 plot compat - #1253

Merged
timtreis merged 9 commits into
mainfrom
fix/scanpy-113-plot-compat
Aug 10, 2026
Merged

fix: ci's and scanpy 1.13 plot compat#1253
timtreis merged 9 commits into
mainfrom
fix/scanpy-113-plot-compat

Conversation

@selmanozleyen

@selmanozleyen selmanozleyen commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request improves compatibility with recent Scanpy releases, refactors how plotting palettes are imported, and reorganizes experimental plotting tests. It also adjusts test execution in pre-release environments to avoid failures due to external dependencies.

Scanpy compatibility and palette import refactor:

  • Improved compatibility with Scanpy 1.13+ by updating imports in src/squidpy/_compat.py to use the new scanpy.plotting.legacy module when available, including fallback logic for older versions. The default_palette is now also imported via _compat.py and re-exported for use elsewhere.
  • Updated src/squidpy/im/_container.py to import default_palette from squidpy._compat instead of directly from Scanpy, ensuring consistent palette usage regardless of Scanpy version.

Test organization and execution:

  • Moved the visual regression test for stain normalization from tests/experimental/test_stain_normalize.py to a new file, tests/experimental/plotting/test_stain_normalize.py, and updated imports accordingly. [1] [2] [3] [4]
  • Modified hatch.toml to skip running the experimental plotting tests in pre-release environments, preventing unrelated failures due to upstream changes in spatialdata-plot.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.08%. Comparing base (b71dae1) to head (801d533).

Files with missing lines Patch % Lines
src/squidpy/_compat.py 70.83% 7 Missing ⚠️
src/squidpy/pl/_spatial_utils.py 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1253      +/-   ##
==========================================
- Coverage   77.11%   77.08%   -0.04%     
==========================================
  Files          63       63              
  Lines        9418     9436      +18     
  Branches     1585     1585              
==========================================
+ Hits         7263     7274      +11     
- Misses       1554     1561       +7     
  Partials      601      601              
Files with missing lines Coverage Δ
src/squidpy/im/_container.py 85.40% <100.00%> (ø)
src/squidpy/pl/_spatial_utils.py 78.66% <66.66%> (-0.05%) ⬇️
src/squidpy/_compat.py 75.00% <70.83%> (-13.24%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@selmanozleyen selmanozleyen changed the title fix: ci's and scanpy 113 plot compat fix: ci's and scanpy 1.13 plot compat Aug 5, 2026
@selmanozleyen
selmanozleyen marked this pull request as ready for review August 5, 2026 10:24
@selmanozleyen
selmanozleyen requested a review from timtreis August 5, 2026 10:36
Comment thread .github/workflows/test.yaml Outdated
# still visible (and still failing) on its own line, without turning the whole
# pre-release environment red. The stable environments keep running these tests as part
# of the suite in the `test` and `coverage` jobs above.
spatialdata-plot:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, it's not really out of our hands, I own that repo and all of scverse has merge and release rights 👀 I don't think we need this extra action. The pre-release failures there were the same as for Squidpy and are resolved with the next release. I've so far been holding off on a release because I was hoping that 2 PRs get merged in spatialdata, but that has been dragging on a lot, so I'll probably just go ahead and release that. Then we can just lowerpin sdata-plot whose CI is clean at this point, including pre-release.

assert out.sizes["c"] == 3


class TestStainNormalizationVisual(PlotTester, metaclass=PlotTesterMeta):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we deleting this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah, just moving, nvm

@timtreis timtreis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need the sdata-plot testing group, we own that repo so we can make sure it's fine upstream. Please reduce to just the scanpy compat layer

@selmanozleyen

Copy link
Copy Markdown
Member Author

We don't need the sdata-plot testing group, we own that repo so we can make sure it's fine upstream. Please reduce to just the scanpy compat layer

For me, that's why it made sense to treat it differently. It's not out of our hand really but the fix is out of squidpy's scope. But I will revert unless you change your mind.

@selmanozleyen
selmanozleyen requested a review from timtreis August 10, 2026 15:10
@timtreis

Copy link
Copy Markdown
Member

sdata-plot is fairly mature in the niche that it covers, I don't foresee huge dev efforts happening in it unless SpatialData fundamentally changes. So keeping its CI green shouldn't be too much work (unless it's inherited from SpatialData like we had a few months ago, but at that point, Squidpy fails anyway because of the direct sdata dependency) 👌

@timtreis timtreis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@timtreis
timtreis merged commit a88aa72 into main Aug 10, 2026
15 checks passed
@timtreis
timtreis deleted the fix/scanpy-113-plot-compat branch August 10, 2026 17:24
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.

2 participants