Skip to content

Allow overriding scale_factor in visium hd#394

Merged
LucaMarconato merged 3 commits intomainfrom
visium-hd-override-scale-factor
Apr 30, 2026
Merged

Allow overriding scale_factor in visium hd#394
LucaMarconato merged 3 commits intomainfrom
visium-hd-override-scale-factor

Conversation

@LucaMarconato
Copy link
Copy Markdown
Member

@LucaMarconato LucaMarconato commented Apr 30, 2026

Continuing working from #383, original PR from @Tobiaspk.

Extract scale_factors from image_models_kwargs once via .get() into a
local variable and build a filtered copy without the key, so the caller's
mapping is never mutated. Reverts the signature back to Mapping[str, Any].
Adds docstring explaining the scale_factors special-case behaviour.
Also fixes a missing colon on _infer_dataset_id introduced on the branch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LucaMarconato LucaMarconato marked this pull request as ready for review April 30, 2026 15:17
@LucaMarconato
Copy link
Copy Markdown
Member Author

LucaMarconato commented Apr 30, 2026

@Tobiaspk thanks for opening the original PR. I made some changes since I wanted to avoid the .pop(), which would have otherwise modified the input from the user. The new approach makes a copy and leaves the user's input unaltered.

Also, I documented the usage of scale_factors in the docstring.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.85%. Comparing base (433014e) to head (7b8d24c).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_io/readers/visium_hd.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #394      +/-   ##
==========================================
+ Coverage   61.65%   61.85%   +0.19%     
==========================================
  Files          27       26       -1     
  Lines        3161     3138      -23     
==========================================
- Hits         1949     1941       -8     
+ Misses       1212     1197      -15     
Files with missing lines Coverage Δ
src/spatialdata_io/readers/visium_hd.py 75.41% <80.00%> (+0.24%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaMarconato LucaMarconato merged commit d13a407 into main Apr 30, 2026
4 checks passed
@LucaMarconato LucaMarconato deleted the visium-hd-override-scale-factor branch April 30, 2026 15:22
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.

Bug: Visium HD reader has hardcoded scale factors for full-res images

3 participants