Skip to content

Raise ValueError on invalid scale in render_images#654

Merged
timtreis merged 1 commit intomainfrom
fix/issue-623-invalid-scale-error
May 8, 2026
Merged

Raise ValueError on invalid scale in render_images#654
timtreis merged 1 commit intomainfrom
fix/issue-623-invalid-scale-error

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented May 8, 2026

Summary

  • render_images(scale=...) silently reset unknown scale names to None and auto-picked a resolution, discarding the user's intent.
  • The downstream _multiscale_to_spatial_image already had the right ValueError but was unreachable because _validate_image_render_params cleared the value beforehand.
  • Validate at the entry point and surface the error with the list of valid scales (including "full").

Closes #623

Previously, render_images(scale="...") silently reset an unknown scale
name to None and auto-picked a resolution, discarding the user's intent
without warning. The downstream _multiscale_to_spatial_image already had
the right ValueError but was unreachable because the value was cleared
beforehand. Validate at the entry point and surface the error with the
list of valid scales.

Closes #623
@timtreis timtreis merged commit 14b9ffe into main May 8, 2026
6 of 7 checks passed
@timtreis timtreis deleted the fix/issue-623-invalid-scale-error branch May 8, 2026 21:55
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.07%. Comparing base (29b1cc1) to head (b0c1cde).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_plot/pl/utils.py 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #654   +/-   ##
=======================================
  Coverage   77.07%   77.07%           
=======================================
  Files          11       11           
  Lines        3276     3276           
  Branches      772      772           
=======================================
  Hits         2525     2525           
  Misses        453      453           
  Partials      298      298           
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/utils.py 67.31% <50.00%> (ø)
🚀 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render_images(scale='nonexistent') silently falls back to auto-resolution with no warning

2 participants