Skip to content

v1.3.2 — aggregate_sample_features refactor

Choose a tag to compare

@raylim raylim released this 03 Apr 17:20
· 87 commits to main since this release

Changes

aggregate_sample_features refactor (#115, #112, #116)

  • Utility now accepts arrays instead of file paths — aggregate_sample_features() takes features_list / coords_list (List[np.ndarray]) and returns a dict[str, tuple[np.ndarray, np.ndarray]] mapping sample IDs to aggregated arrays; file I/O moved to the CLI wrapper
  • PT tensor output — CLI now also writes a .pt tensor alongside each H5 by default; opt out with save_pt=false
  • Per-sample streaming — CLI reads H5 inputs one sample at a time so peak memory scales with the largest sample, not the full cohort
  • Input validation — raises an informative ValueError (with slide index and sample ID) on mismatched lengths or wrong array shapes
  • Tighter types — return type and internal dicts use dict[str, tuple[np.ndarray, np.ndarray]] instead of bare dict; collections.OrderedDict replaced with plain dict (Python ≥3.10 preserves insertion order)