Skip to content

Fix inverted transfunc condition in render_shapes; add transfunc to render_labels#635

Merged
timtreis merged 6 commits intomainfrom
fix/issue-596-transfunc-inverted-condition
Apr 24, 2026
Merged

Fix inverted transfunc condition in render_shapes; add transfunc to render_labels#635
timtreis merged 6 commits intomainfrom
fix/issue-596-transfunc-inverted-condition

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented Apr 24, 2026

Summary

  • _render_shapes had an inverted condition: if values_are_categorical instead of if not values_are_categorical, so transfunc was silently ignored for continuous data and crashed with TypeError for categorical data
  • render_labels had no transfunc support at all — added the field to LabelsRenderParams, wired it through basic.py, and applied the same guard already present in _render_points

Fixes #596.

timtreis and others added 2 commits April 24, 2026 16:14
…ort to render_labels

The guard in _render_shapes was `if values_are_categorical` instead of
`if not values_are_categorical`, causing transfunc to be silently
ignored for continuous data and to crash with a TypeError for
categorical data.

render_labels had no transfunc support at all. Added the field to
LabelsRenderParams, wired it through basic.py, and applied the same
guard already present in _render_points.

Fixes #596.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.37%. Comparing base (525c94a) to head (0727f88).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
+ Coverage   76.32%   76.37%   +0.05%     
==========================================
  Files          11       11              
  Lines        3227     3230       +3     
  Branches      757      758       +1     
==========================================
+ Hits         2463     2467       +4     
+ Misses        465      464       -1     
  Partials      299      299              
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 85.48% <ø> (ø)
src/spatialdata_plot/pl/render.py 86.49% <100.00%> (+0.34%) ⬆️
src/spatialdata_plot/pl/render_params.py 86.69% <100.00%> (+0.06%) ⬆️

... 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 and others added 4 commits April 24, 2026 16:41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@timtreis timtreis merged commit 9afec7e into main Apr 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transfunc silently ignored for continuous data in render_shapes; crashes for categorical data

2 participants