Skip to content

Drop vmin/vmax kwargs across all render functions#652

Merged
timtreis merged 2 commits intomainfrom
fix/issue-612-remove-vmin-vmax
May 8, 2026
Merged

Drop vmin/vmax kwargs across all render functions#652
timtreis merged 2 commits intomainfrom
fix/issue-612-remove-vmin-vmax

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented May 8, 2026

Closes #612.

Summary

  • The vmin/vmax deprecation guard (added in Fix clims when plotting shapes element annotations with matplotlib rendering #368, Oct 2024) lived in render_shapes, render_points, and render_labels and relied on **kwargs. render_images has a closed signature, so the same call crashed with TypeError: got an unexpected keyword argument 'vmin' on that one function only.
  • Resolves the asymmetry by removing support rather than adding **kwargs to render_images. The deprecation has been in place for over a year; users should migrate to norm=Normalize(vmin=..., vmax=...).
  • Promotes the two parameters that were actually being smuggled through **kwargs (datashader_reduction, transfunc) to explicit keyword-only params with proper docstrings. Behaviour unchanged; ergonomics improved (autocomplete, type checking).

After this PR, all four render_* functions reject vmin/vmax (and any other unsupported kwarg) with a uniform TypeError from Python.

Breaking changes

  • vmin= / vmax= are no longer accepted on any render_* function. Migration: norm=matplotlib.colors.Normalize(vmin=..., vmax=...).
  • Typo'd kwargs that were previously silently swallowed by **kwargs (e.g. color_map=...) now raise TypeError. This is the intended outcome of closing the signatures.

Removes the long-standing vmin/vmax deprecation guard from render_shapes,
render_points, and render_labels (deprecated since #368, Oct 2024). The
guard relied on **kwargs and never existed on render_images, so the same
call worked on three functions and crashed with TypeError on the fourth.

Resolves the asymmetry by dropping support entirely rather than adding
**kwargs to render_images. The two parameters previously smuggled through
**kwargs (datashader_reduction, transfunc) are now explicit keyword-only
params with proper docstrings. After this, all four render functions
reject vmin/vmax (and any other unsupported kwarg) with a uniform
TypeError. Users migrate to norm=Normalize(vmin=..., vmax=...).
These calls passed `table=` to `render_labels`, which has no such
parameter (it's `table_name=`). Previously silently swallowed by
`**kwargs`; surfaced as a TypeError after the signature was closed.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.07%. Comparing base (27728a1) to head (a4b67ab).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #652      +/-   ##
==========================================
+ Coverage   76.86%   77.07%   +0.20%     
==========================================
  Files          11       11              
  Lines        3277     3276       -1     
  Branches      774      772       -2     
==========================================
+ Hits         2519     2525       +6     
+ Misses        457      453       -4     
+ Partials      301      298       -3     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 86.37% <100.00%> (+0.96%) ⬆️

... and 2 files 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 29b1cc1 into main May 8, 2026
7 of 8 checks passed
@timtreis timtreis deleted the fix/issue-612-remove-vmin-vmax branch May 8, 2026 18:02
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.

vmin/vmax deprecated kwargs work on 3 render functions but crash on render_images

2 participants