Skip to content

Migrate dense_slide_extraction off hs2p's removed TilingConfig.tissue_threshold (#97)#103

Merged
clemsgrs merged 1 commit into
mainfrom
fix/97-dense-tissue-threshold-migration
Jun 24, 2026
Merged

Migrate dense_slide_extraction off hs2p's removed TilingConfig.tissue_threshold (#97)#103
clemsgrs merged 1 commit into
mainfrom
fix/97-dense-tissue-threshold-migration

Conversation

@clemsgrs

Copy link
Copy Markdown
Owner

Context

hs2p 4.2.0 (clemsgrs/hs2p#158) collapsed the derived TilingConfig.tissue_threshold scalar into the resolved min_coverage map — min_coverage["tissue"] is now the single source of truth for the tissue threshold. soma's slide-manifest dense path constructed hs2p.TilingConfig(tissue_threshold=...) directly, which now raises TypeError.

soma was in fact already broken on a fresh install: the existing slide2vec[fm]>=4.8.0 floor resolves to slide2vec 5.0.0, which requires hs2p>=4.2.0 — dragging in the field removal regardless of soma's own hs2p pin.

Changes

  • dense_slide_extraction._build_tiling_config: feed min_coverage={"tissue": ...} instead of the removed scalar. The per-class sampling map still flows separately through _resolve_sampling_spec_from_masks(masks, …); this tiling-level entry only feeds the result's binary min_tissue_fraction provenance, so ROI coordinates — and the dense cache key, which never referenced TilingConfig — are unchanged.
  • pyproject.toml: bump hs2p >=4.1.1>=4.2.0 and slide2vec[fm] >=4.8.0>=5.0.0. The bumps are coupled: slide2vec must be >=5.0.0 to run on hs2p 4.2.0 (4.8.0 still reads the removed field). soma does not touch the one breaking public API in slide2vec 5.0.0 (Model.embed_slides nested dict, slide2vec#178) — it drives the lower-level runtime, whose 4.8.0→5.0.0 delta is small and additive.

Testing

Full suite green against hs2p 4.2.0 + slide2vec 5.0.0: 1106 passed, 3 skipped, 1 xfailed. test_sphinx_docs_build deselected for a missing docutils env dep (unrelated).

Acceptance criteria

  • No bare tissue_threshold= scalar into hs2p.TilingConfig
  • hs2p>=4.2.0 pin (+ coupled slide2vec>=5.0.0)
  • No on-disk cache invalidation (dense key independent of TilingConfig)
  • Full soma suite green

Closes #97

…_threshold (#97)

hs2p 4.2.0 (clemsgrs/hs2p#158) collapsed the derived TilingConfig.tissue_threshold
scalar into the resolved min_coverage map (min_coverage["tissue"] is the tissue
threshold, the single source of truth). soma's slide-manifest dense path constructed
hs2p.TilingConfig(tissue_threshold=...) directly, which now raises TypeError.

- dense_slide_extraction._build_tiling_config: feed min_coverage={"tissue": ...}
  instead of the removed scalar. The per-class sampling map still flows separately
  through _resolve_sampling_spec_from_masks(masks, ...); this tiling-level entry only
  feeds the result's binary min_tissue_fraction provenance, so ROI coordinates and
  the dense cache key (which never referenced TilingConfig) are unchanged.
- pyproject: bump hs2p >=4.1.1 -> >=4.2.0 and slide2vec[fm] >=4.8.0 -> >=5.0.0.
  The bumps are coupled: slide2vec must be >=5.0.0 to run on hs2p 4.2.0 (4.8.0 still
  reads the removed field), and the existing >=4.8.0 floor already resolved to 5.0.0
  -> hs2p>=4.2.0, so soma was already broken on a fresh install.

Full suite green against hs2p 4.2.0 + slide2vec 5.0.0 (1106 passed, 3 skipped,
1 xfailed; test_sphinx_docs_build deselected for a missing docutils env dep).

Closes #97
@clemsgrs
clemsgrs merged commit c03294b into main Jun 24, 2026
3 checks passed
@clemsgrs
clemsgrs deleted the fix/97-dense-tissue-threshold-migration branch June 24, 2026 19:10
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.

soma: migrate dense_slide_extraction off hs2p's removed TilingConfig.tissue_threshold scalar

1 participant