multigedi.io.load_model

multigedi.io.load_model(adata, filename, *, key='gedi')[source]

Load a safely serialized GEDI result tree into .uns.

Only the versioned JSON-manifest NPZ format written by save_model() is accepted. NumPy archives are always opened with allow_pickle=False; legacy archives containing stringified Python dictionaries are rejected.

Parameters:
  • adata (AnnData | MuData) – AnnData or MuData container that receives the result tree.

  • filename (str | Path) – Path to a .npz model archive.

  • key (str, default: 'gedi') – Key in adata.uns or mdata.uns where the loaded tree is stored.

Return type:

None

Notes

Loading restores only adata.uns[key] (or mdata.uns[key]). It does not reconstruct or modify X, obs, var, layers, obsm, or varm. The destination is mutated only after the complete archive has passed validation.

Examples

>>> import multigedi as gd
>>> gd.io.load_model(adata, "gedi_model.npz")
>>> adata.uns["gedi"]["model"]