Skip to content

Infer fig from ax in show() instead of requiring it#655

Merged
timtreis merged 1 commit intomainfrom
fix/issue-625-infer-fig-from-axes
May 10, 2026
Merged

Infer fig from ax in show() instead of requiring it#655
timtreis merged 1 commit intomainfrom
fix/issue-625-infer-fig-from-axes

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented May 10, 2026

Summary

  • pl.show(ax=[...]) now infers fig from ax[0].get_figure() instead of raising when fig= is omitted, mirroring the single-axis path.
  • Single-panel branch now accepts a 1-element Sequence of axes (previously left fig unbound and tripped a downstream isinstance(ax, Axes) assert).
  • The fig= deprecation warning now also fires when paired with a list of axes.

Closes #625. Closes #579.

Closes #625, #579.

When a list of `Axes` is passed to `pl.show()`, infer the figure via
`ax[0].get_figure()` rather than raising when `fig=` is omitted, mirroring
the single-axis path. Also normalize a single-element `Sequence` of axes
in the single-panel branch (previously left `fig` unbound and tripped
a downstream `isinstance` assert) and emit the existing `fig=`
deprecation warning for the multi-axis path too.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.07%. Comparing base (14b9ffe) to head (8d659f1).

Files with missing lines Patch % Lines
src/spatialdata_plot/pl/utils.py 37.50% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #655      +/-   ##
==========================================
+ Coverage   77.04%   77.07%   +0.02%     
==========================================
  Files          11       11              
  Lines        3276     3280       +4     
  Branches      772      774       +2     
==========================================
+ Hits         2524     2528       +4     
- Misses        453      454       +1     
+ Partials      299      298       -1     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 86.37% <100.00%> (ø)
src/spatialdata_plot/pl/utils.py 67.33% <37.50%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timtreis timtreis merged commit e5c54fd into main May 10, 2026
7 of 8 checks passed
@timtreis timtreis deleted the fix/issue-625-infer-fig-from-axes branch May 10, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants