Skip to content

[1/4] Add tiling test suite for already-merged _tiling.py#1189

Merged
timtreis merged 4 commits into
scverse:mainfrom
timtreis:feature/tiling-tests
May 28, 2026
Merged

[1/4] Add tiling test suite for already-merged _tiling.py#1189
timtreis merged 4 commits into
scverse:mainfrom
timtreis:feature/tiling-tests

Conversation

@timtreis
Copy link
Copy Markdown
Member

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 on main via #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 on dev-py313.

Four tests from the original PR #982 are not ported: they lock down behaviour that only exists on the feature/add_cpmeasure branch (a target_scale guard in compute_cell_info_multiscale and AssertionError-vs-ValueError in verify_coverage). They will land alongside the matching _tiling.py improvements in a follow-up.

#982 stays open as reference until the four split PRs are up.

anon 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
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.52%. Comparing base (ab6b55d) to head (bd46f64).

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              

see 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 timtreis requested a review from selmanozleyen May 28, 2026 12:32
Copy link
Copy Markdown
Member

@selmanozleyen selmanozleyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to add tests! especially visual ones. But can you tell me will _tiling be exposed to the users?

@timtreis
Copy link
Copy Markdown
Member Author

Not really but I'm reusing the module across like 3 functions already and will probably do more that use it

@timtreis timtreis merged commit 154abbf into scverse:main May 28, 2026
11 of 12 checks passed
@timtreis timtreis deleted the feature/tiling-tests branch May 28, 2026 15:52
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.

2 participants