[1/4] Add tiling test suite for already-merged _tiling.py#1189
Merged
Conversation
added 2 commits
May 28, 2026 00:10
Ports test_tiling.py and the two TilingVisual_*.png baselines from the PR scverse#982 working branch. The tested functions (build_tile_specs, compute_cell_info{,_multiscale,_tiled}, extract_tile{,_lazy}, verify_coverage) all already live on main from scverse#1157; this PR closes the regression-coverage gap that scverse#1157 left behind. Tests covering behaviour that only exists on the PR scverse#982 branch (a target_scale guard and an AssertionError/ValueError divergence in verify_coverage) are not ported here; they will land alongside the matching _tiling.py improvements in a follow-up.
- Replace unicode (multiplication sign, em-dash, arrow) with ASCII per the no-unicode repo rule - Assert test_boundary_cells_exist's boundary_cells list is non-empty so the test cannot pass vacuously if the fixture stops producing boundary-straddling cells - Read channel count from the fixture in test_image_crop_shape instead of hardcoding 3 - Hoist CellInfo into the module-level import and move _make_ci to the top of the file, removing the forward reference - Pass a non-empty cell_info to test_invalid_tile_size so the test pins the tile_size guard, not an empty-dict short-circuit - Drop the dead `gap` element from the brick_labels fixture return; no consumer used it past the comment - Drop the redundant TestEndToEnd.test_touching_cells_no_merge and test_nontouching_cells_same_result; the parametrised test_roundtrip_no_cells_lost already covers both gap values with a stronger invariant
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1189 +/- ##
==========================================
+ Coverage 73.94% 74.52% +0.58%
==========================================
Files 51 51
Lines 7581 7581
Branches 1270 1270
==========================================
+ Hits 5606 5650 +44
+ Misses 1466 1422 -44
Partials 509 509 🚀 New features to boost your workflow:
|
selmanozleyen
approved these changes
May 28, 2026
Member
selmanozleyen
left a comment
There was a problem hiding this comment.
nice to add tests! especially visual ones. But can you tell me will _tiling be exposed to the users?
Member
Author
|
Not really but I'm reusing the module across like 3 functions already and will probably do more that use it |
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.
PR 1/4 of the #982 split (plan: PR-1 tests, PR-2 skimage+squidpy features, PR-3 alignment, PR-4 cp_measure).
Adds the test suite for
squidpy.experimental.im._tiling— the tiling infrastructure that landed onmainvia #1157 without its tests. No src changes.Covers
build_tile_specs,compute_cell_info,compute_cell_info_multiscale,compute_cell_info_tiled,extract_tile,extract_tile_lazy,verify_coverage, plus visual baselines for tile-assignment regressions. 40 tests pass ondev-py313.Four tests from the original PR #982 are not ported: they lock down behaviour that only exists on the
feature/add_cpmeasurebranch (atarget_scaleguard incompute_cell_info_multiscaleandAssertionError-vs-ValueErrorinverify_coverage). They will land alongside the matching_tiling.pyimprovements in a follow-up.#982 stays open as reference until the four split PRs are up.