Skip to content

Accept list and ndarray for show(figsize=...)#646

Merged
timtreis merged 3 commits intomainfrom
fix/issue-626-figsize-sequence
May 8, 2026
Merged

Accept list and ndarray for show(figsize=...)#646
timtreis merged 3 commits intomainfrom
fix/issue-626-figsize-sequence

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented May 8, 2026

Summary

Validator only accepted tuple, rejecting the idiomatic figsize=[w, h]
and programmatically built numpy arrays. matplotlib accepts both, so
the restriction was unnecessary friction.
@timtreis timtreis changed the title Accept list and ndarray for show(figsize=...) (closes #626) Accept list and ndarray for show(figsize=...) May 8, 2026
timtreis added 2 commits May 8, 2026 12:49
- Drop `numbers.Real` dependency; use `int | float` to match the
  existing idiom in `_validate_show_parameters`.
- Inline the sequence-type check; tighten error message.
- Test `_validate_show_parameters` directly so the reject cases skip
  fixture setup and rendering (drops runtime from ~4s to <0.1s).
Per maintainer preference, omit the parametrized validator tests.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.35%. Comparing base (8e8c5e4) to head (18de92a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_plot/pl/utils.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #646   +/-   ##
=======================================
  Coverage   76.35%   76.35%           
=======================================
  Files          11       11           
  Lines        3239     3239           
  Branches      762      762           
=======================================
  Hits         2473     2473           
  Misses        467      467           
  Partials      299      299           
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/utils.py 66.27% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timtreis timtreis merged commit 2a3e262 into main May 8, 2026
7 of 8 checks passed
@timtreis timtreis deleted the fix/issue-626-figsize-sequence branch May 8, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show(figsize=[10, 6]) raises TypeError — only tuples accepted, not lists or arrays

2 participants