Repository navigation
Releases
Releases · theislab/modelbinder
v0.2.0
Removed
- Breaking: the module-level
registry.to_spec(config)andregistry.parse(spec); useconfig.to_spec()andComponent.from_spec(spec)(orFamily.from_spec(spec), which also checks the family) - Breaking:
@component(..., builds=Impl)andregistry.config_of; what a config builds is typed by itsbuildreturn annotation
v0.1.0
Changed
- Breaking: scfit is renamed modelbinder:
scfit.registryismodelbinder.registryandscfit.pretrainedismodelbinder.pretrained. New model cards saylibrary_name: modelbinder; cards written by scfit still load - Breaking: the data layer
scfit.datamoved to its own package, boundannbatch:from scfit.data import Loaderis nowfrom boundannbatch import Loader. modelbinder no longer depends on annbatch, anndata or zarrs
v0.0.14
Added
scfit.data.open_adata(path, *refs, uns_keys=...)opens a.zarror.h5adstore with exactly the parts theanndata.accreferences name:A.X,A.layers[k],A.obsm[k](arrays, on disk for zarr),A.obs[col]andA.obs.index. A.h5adfile's arrays are read into memory and the file is closed
Changed
- Breaking: array locations are
anndata.accreferences instead of loc strings.Stream(reps=...)is required (no default:A.Xis never implied) and takesA.X,A.layers[k]orA.obsm[k], or a sequence of them, and rejects strings and references into an array. Batches fromLoaderandEvalLoaderare keyed by these references:batch["primary"][A.obsm["X_pca"]]. Migrate"X"toA.X,"obsm/X_pca"toA.obsm["X_pca"]and"layers/k"toA.layers["k"]; a config string resolves withA.resolve("obsm.X_pca", vec=False).group_byandmatch_onstay column names - Breaking:
open_source(src, keys=..., cols=..., uns=...)is nowopen_source(src, *refs, uns_keys=...), with arrays,A.obs[col]andA.obs.indexas references. It also opens.h5adpaths, reading only the named parts load_backed_adatais removed;open_adataandopen_sourceopen zarr stores the same wayopen_adataandopen_sourceraise oneKeyErrornaming every missing rep, obs column and uns key, with what the store has, instead of failing on the first lookup- annbatch is installed with its
numbaextra, which it needs to stream in-memory sparse arrays such as a.h5adX - A source whose files hold a rep on disk in some (zarr) and in memory in others (
.h5ad, in-memory AnnData) raises, since annbatch streams one kind per source;.h5adis always read into memory open_adata(..., missing="skip")leaves out the parts a store lacks instead of raising, for a dataset whose files each hold some of them- An annbatch
DatasetCollectionroot is refused in a list of paths too, and obs columns come back in the requested order
v0.0.13
Changed
- The
cuda12extra is replaced bycupy-cuda12andcupy-cuda13, which install annbatch's extras of the same name (cupy with its CUDA toolkit wheels); pick the one matching your CUDA major
v0.0.12
Added
batch["rows"]:LoaderandEvalLoaderbatches name the global rows each stream read ({stream: int64 rows}, the source's files concatenated in order), aligned with its reps
Changed
- Link names
leaves,leafandrowsare reserved, likeprimary
v0.0.11
Added
Stream(group_by=()): every cell is one group, whose leaf is(), for unconditional streams (no grouping column needed)
v0.0.10
Added
data.obs_columnsanddata.open_sourceare public: obs columns of one AnnData or several read as one dataset, and zarr stores opened backed.open_source(andload_backed_adata) takeuns=to read named.unsentries
Fixed
- Several AnnData in one source with different categories in a grouping column no longer fail to load (the categories are unioned)
Changed
- annbatch
>=0.3.1replaces the==0.2.1pin and the shim over it (vendored samplers and a patchedLoader.__iter__): the primary samples with annbatch'sClassSampler, links with a newBoundClassSamplerbuilt on it, and each batch's group is read from the leaf the loaders carry as obs
v0.0.9
Added
pretrained.save_pretrained/load_pretrained: a spec with its weights asconfig.jsonplus<name>/model.safetensors, in the Hugging Face Hub layout;load_pretrainedalso takes a Hub repo id. torch, safetensors and huggingface-hub are now dependencies
Removed
- Spec versions: a spec is
{"type": type_id, **fields}, and@componenttakes noversion/versions. Specs written with a"version"key no longer load; a saved spec reads back under the package versions that wrote it
v0.0.8
Added
registryon pydantic: aComponentis a frozen pydantic model, and a spec is{"type": type_id, "version": n, **fields}JSON.@component(type_id, version=, versions=)registers it; a field typed as a family base parses any registered member, so families stay open to other packages, and each member is written with its own fields@component(type_id, builds=Impl)links a config to its implementation (registry.config_of)data.SamplerParams: a small model of the sampler settings, passed assampler=(or a plain mapping) toLoaderandLoader.from_paths, with per-stream overrides instream_samplers=
Removed
- cattrs and attrs
- The
{type, version, config}envelope registry.register_live: anything a spec cannot hold (a live object, or a value that does not read back) raisesPortabilityErrorwhen the spec is writtenregistry.build,Component.buildandComponent.build_spec: each family declares its own typedbuilddata.SamplerKwargs, thebatch_size/chunk_size/preload_nchunkskeywords, and sampler settings onStream: passsampler=/stream_samplers=to the loader
Fixed
registry: components insidedict,listandtuplefields keep their type throughto_spec/parse(#14)
v0.0.7
What's Changed
- Refactor Loader for infinite streaming and reduce code bloat by @selmanozleyen in #10
Full Changelog: v0.0.6...v0.0.7