Drop vmin/vmax kwargs across all render functions#652
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #612.
Summary
vmin/vmaxdeprecation guard (added in Fix clims when plotting shapes element annotations with matplotlib rendering #368, Oct 2024) lived inrender_shapes,render_points, andrender_labelsand relied on**kwargs.render_imageshas a closed signature, so the same call crashed withTypeError: got an unexpected keyword argument 'vmin'on that one function only.**kwargstorender_images. The deprecation has been in place for over a year; users should migrate tonorm=Normalize(vmin=..., vmax=...).**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 rejectvmin/vmax(and any other unsupported kwarg) with a uniformTypeErrorfrom Python.Breaking changes
vmin=/vmax=are no longer accepted on anyrender_*function. Migration:norm=matplotlib.colors.Normalize(vmin=..., vmax=...).**kwargs(e.g.color_map=...) now raiseTypeError. This is the intended outcome of closing the signatures.