Skip to content

Reject contour_px=1 in render_labels#645

Merged
timtreis merged 2 commits intomainfrom
fix/issue-631-contour-px-1
May 8, 2026
Merged

Reject contour_px=1 in render_labels#645
timtreis merged 2 commits intomainfrom
fix/issue-631-contour-px-1

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented May 8, 2026

Summary

Closes #631.

A 1x1 erosion footprint is the identity transformation, so
`contour = seg - erosion(seg, footprint_rectangle((1,1)))` is zero
everywhere and the outline silently disappears. Raise ValueError with
guidance to use contour_px >= 2 instead of failing silently.
@timtreis timtreis changed the title Reject contour_px=1 in render_labels (closes #631) Reject contour_px=1 in render_labels May 8, 2026
@timtreis timtreis merged commit 1097896 into main May 8, 2026
7 of 8 checks passed
@timtreis timtreis deleted the fix/issue-631-contour-px-1 branch May 8, 2026 10:47
@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.31%. Comparing base (072f04e) to head (6de9b6b).
⚠️ Report is 2 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     #645      +/-   ##
==========================================
- Coverage   76.39%   76.31%   -0.08%     
==========================================
  Files          11       11              
  Lines        3237     3239       +2     
  Branches      761      762       +1     
==========================================
- Hits         2473     2472       -1     
- Misses        466      467       +1     
- Partials      298      300       +2     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 85.66% <ø> (ø)
src/spatialdata_plot/pl/utils.py 66.21% <0.00%> (-0.07%) ⬇️

... 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.

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.

render_labels(contour_px=1) produces no visible outline (1×1 erosion is identity)

2 participants