You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vmin/vmax deprecated kwargs work on 3 render functions but crash on render_images #612
vmin/vmax deprecated kwargs work on 3 render functions but crash on render_images
Description
render_shapes, render_points, and render_labels all accept vmin/vmax via **kwargs and emit a helpful deprecation warning. render_images has a fixed signature with no **kwargs, so the same call crashes with TypeError: got an unexpected keyword argument 'vmin'. Users migrating from the old API face a confusing asymmetry across four otherwise-identical render functions.
importmatplotlib; matplotlib.use("Agg")
importmatplotlib.pyplotaspltimportwarningsimportdask; dask.config.set({"dataframe.query-planning": False})
importspatialdataassdimportspatialdata_plotsdata=sd.datasets.blobs(n_points=50)
img_key=list(sdata.images.keys())[0]
shapes_key=list(sdata.shapes.keys())[0]
# These three work (deprecation warning emitted):withwarnings.catch_warnings():
warnings.simplefilter("ignore")
sdata.pl.render_shapes(shapes_key, vmin=0, vmax=1)
print("render_shapes: OK")
# This crashes:sdata.pl.render_images(img_key, vmin=0, vmax=200)
print("render_images: OK")
Expected vs. Actual
Expected: render_images emits the same deprecation warning as the other three functions and continues (directing users to use norm=Normalize(vmin=..., vmax=...)).
Actual: TypeError: PlotAccessor.render_images() got an unexpected keyword argument 'vmin'
Fix Sketch
Add **kwargs to render_images and copy the vmin/vmax deprecation guard from the other three functions (basic.py:301-302). Alternatively, explicitly document the asymmetry if it is intentional — though inconsistency across four sibling functions is a usability hazard regardless.
Activity