Repository navigation
Collapse cohort layer into one SpatialDataCohort; version-pinned freeze/manifest - #20
Merged
Merged
Conversation
…FrozenCohort + build/materialize; update exports
…arch exempt, split mode, empty-cohort + set-filter round-trip
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
==========================================
+ Coverage 91.91% 92.00% +0.08%
==========================================
Files 19 18 -1
Lines 1460 1450 -10
==========================================
- Hits 1342 1334 -8
+ Misses 118 116 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Collapses the client's two cohort classes into one immutable
SpatialDataCohort, reduces "frozen" to a serializableCohortManifest, pins cohorts to exact full-uid dataset versions, and cuts the downstream task-adapter execution code out of the client. Breaking change to the cohort surface (client is 0.x).What changed
One cohort object (
cohort.py)freeze()→ offlineCohortManifest(identity = sha256 over the members' full lamin uids + canonical filter; no content fingerprint, no network).from_manifest()rehydrates without a catalog re-query.filter(**facets),where(mask),|(union, deduped by uid),-(difference) — all return new cohorts.verify()= liveness check (pinned store resolves + opens);check_updates(catalog)= stem-join supersession detection.download(dest, *, strict=False)— resumable; a missing pinned store falls back to the latest version with a loud warning, or raisesCohortDriftErrorunderstrict/ when no fallback resolves.split(...)→{fold: SpatialDataCohort}(group-safe, deterministic), each carrying the derivedSplitManifest.to_anndata()→ outer join withobs['uid']+obs['study_id'].sdatas/load(elements=...)for explicit object loading;Dataset.load(elements=...).Catalog / schema
Catalog.cohort(uids=[...] | study_ids=[...])explicit construction.study_idanddoiare now query facets (doiis exempt from free-textsearchto avoid DOI-fragment false matches).Manifest (
manifest.py)CohortManifestidentity record (JSON, with a parquet sidecar for large member sets) alongside the existing resumable downloadManifest.Removals
FrozenCohort/freeze.py, andbuild/materialize/check/TaskView/PreflightReport+ element-resolution machinery fromadapter.py— the client keeps only theTaskAdapterProtocol (adapter execution is downstream). Removal canary tests enforce un-importability.Version model (context)
A frozen cohort is pinned to the exact full lamin
uid@version. Byte-exact retrieval of superseded versions depends on an engine-side change (retain each version's.zarrviaoverwrite_versions=False) that is release-gated and out of scope here; the client is forward-compatible against that contract. See the design spec for the full version model.Testing
Full suite green: 284 passed, 4 skipped, 5 network-deselected.
ruff checkclean. TDD throughout; a whole-branch review added non-mocked tests for the download missing-store path.Follow-ups (non-blocking)
__or__/__sub__could returnNotImplementedfor a non-cohort operand.stacklevel; slicing a split fold drops.split_manifest.