Skip to content

feat: add configurable columns to PAGA plots - #4325

Open
AtomicGlance wants to merge 4 commits into
scverse:mainfrom
AtomicGlance:feat/paga-ncols
Open

AtomicGlance wants to merge 4 commits into
scverse:mainfrom
AtomicGlance:feat/paga-ncols

Conversation

@AtomicGlance

Copy link
Copy Markdown

Summary

  • Add an ncols parameter to sc.pl.paga for wrapping multiple color panels into a grid.
  • Preserve the existing single-row layout when ncols=None.
  • Keep colorbars aligned with grid panels and validate invalid column counts.
  • Add regression coverage and a release-note fragment.

Closes #1203

Tests

  • pytest -q tests/plotting/legacy/test_paga.py -k paga_ncols -o filterwarnings=: 8 passed
  • Ruff, Python byte-compilation, and git diff --check pass.
  • The rest of test_paga.py passes 24 tests; one unrelated test needs to download the existing pbmc3k fixture, which is blocked in this environment.

@AtomicGlance

Copy link
Copy Markdown
Author

The code and focused tests are in place. One repository metadata check is failing only because this fork PR cannot add the required no milestone label without upstream permissions. Could a maintainer add that label or assign a milestone?

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.95%. Comparing base (5f2accb) to head (89eaa97).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##           main    #4325       +/-   ##
=========================================
+ Coverage      0   81.95%   +81.95%     
=========================================
  Files         0      134      +134     
  Lines         0    13046    +13046     
=========================================
+ Hits          0    10692    +10692     
- Misses        0     2354     +2354     
Flag Coverage Δ
hatch-test.low-vers 78.75% <42.85%> (?)
hatch-test.pre 81.82% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scanpy/plotting/legacy/_tools/paga.py 65.53% <100.00%> (ø)

... and 133 files with indirect coverage changes

@AtomicGlance

Copy link
Copy Markdown
Author

Thanks for flagging this. I added coverage for invalid ncols values, the ncols plus pre-supplied ax error, and a custom colorbar axis, then pushed b6c4457. The focused PAGA tests now pass 11 cases; Codecov should rerun on the new commit.

@AtomicGlance

Copy link
Copy Markdown
Author

CI reran on the latest commit. The PAGA-focused tests pass and Codecov reports 100% patch coverage.\n\nThe remaining Python 3.14 failure is unrelated to this change: ests/test_logging.py::test_logfile finishes with 3,033 tests passed and one teardown error from an unclosed-file ResourceWarning. That test is unchanged in this PR and the diff is limited to PAGA code, tests, and the release-note fragment, so I have not added an unrelated fix.\n\nThe title/milestone/labels check is also still blocked because this fork cannot add the repository's no-milestone label or assign a milestone. Could a maintainer handle that metadata check and advise whether the Python 3.14 logging failure should be rerun or tracked upstream?

@flying-sheep flying-sheep added this to the 1.13.0 milestone Sep 4, 2026
@flying-sheep

Copy link
Copy Markdown
Member

Thanks! Please add a release note. It should end with {smaller}`A Moradniaei`

@AtomicGlance

AtomicGlance commented Sep 5, 2026

Copy link
Copy Markdown
Author

Done — I renamed the fragment to 4325.feat.md so it matches the PR-number convention and updated the credit to {smaller}A Moradniaei`. The release-note check is passing now.

The fresh broader run has one unrelated failure in the Python 3.14 pre-release job: the spatial doctest received a ResourceWarning for an unclosed 10x_pbmc68k_reduced.zarr.zip file. That job passed on the previous head, 3,075 tests passed in this run, and this commit only changes the release-note filename and credit. I cannot rerun upstream workflows from the fork; could a maintainer rerun that job?

Signed-off-by: AtomicGlance <amiralimoradniaei@gmail.com>
Signed-off-by: AtomicGlance <amiralimoradniaei@gmail.com>
@AtomicGlance

Copy link
Copy Markdown
Author

I synchronized this branch with current scverse/scanpy:main (5f2accb). The upstream update includes the AnnData-version guard for zarr_write_format, which was causing the Python 3.14 fixture setup to fail before the PAGA tests ran. The PR diff remains limited to the PAGA implementation, tests, and release note. The local Hatch test environment is not installed here, so the focused and matrix validation should come from the new CI run.

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.

sc.pl.paga: TypeError: paga() got an unexpected keyword argument 'ncols'

2 participants