pypi ehrdata 0.4.0
0.4.0 🌈 Release

4 hours ago

Release adding on-disk persistence for 3-D sparse .X/layers, following the binsparse specification.

Added

  • {func}~ehrdata.io.write_h5ed/{func}~ehrdata.io.read_h5ed and {func}~ehrdata.io.write_zarr/{func}~ehrdata.io.read_zarr can now persist a 3D .X/layer stored as a pydata sparse.COO tensor. Following closely the binsparse specification (per-axis indices_<dim> + values datasets, a fill_value, and a JSON binsparse descriptor). The descriptor labels dtypes with binsparse's canonical data-type strings; boolean tensors round-trip as bint8 (stored on disk as uint8). Supported specifically for the reserved 3D X/layer slots; a sparse.COO in any other slot raises a clear error. (#276) @eroell

Fixed

  • {func}~ehrdata.harmonize_missing_values and the read-time float casting no longer choke on boolean arrays. Boolean arrays are now treated like numeric ones (nothing to harmonize/cast). (#264) @eroell
  • {func}~ehrdata.move_to_obs now reads values from the requested layer instead of always reading .X; passing layer= previously validated the layer but silently moved .X's values. (#279) @eroell
  • {func}~ehrdata.integrations.vitessce.gen_default_config no longer fails with X must be 2-dimensional when the time series lives in a 3D .X (e.g. from {func}~ehrdata.dt.physionet2019); the selected source is reduced to the chosen timestep before writing, and layer now defaults to None (use .X). (#271) @eroell
  • {func}~ehrdata.infer_feature_types binary detection contained a latent bug: the integrality guard used np.all(<generator>), which is always truthy and so never actually ran. The check is now the equivalent, correct set(col.unique()) == {0, 1}. No user-visible behaviour changes, as the disabled guard was redundant with the {0, 1} set check. (#268) @Zethson
  • {func}~ehrdata.infer_feature_types no longer emits a warning with a blank feature name (Feature was detected as categorical features stored numerically.) when no feature is uncertain. The warning is now only shown when at least one feature was detected as categorical stored numerically, and lists the affected feature names. (#267) @Zethson
  • Slicing a 3D {attr}~ehrdata.EHRData.X along the time axis now also slices .X. Previously, subsetting the third axis updated .shape and .tem but returned the parent's full-length .X, so edata[:, :, idx].X.shape disagreed with edata[:, :, idx].shape. .X now applies the time-axis index exactly like a 3D layer. (#259) @eroell

Documentation

  • The {class}~ehrdata.EHRData attribute reference now describes .obsm, .varm, .obsp and .varp in anndata's terms instead of showing a generic placeholder. (#263) @eroell
  • Updated logo with 3D .X. Tutorials updated to use .X canonically. Docstring examples no longer pass layer="tem_data": the time series is kept in the default 3D .X. (#273) @eroell

Don't miss a new ehrdata release

NewReleases is sending notifications on new releases.