You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VCSCAnnData.__getitem__ (src/vsparse/_anndata_class.py:154-182) is always an eager copy. This means every subset operation pays a full materialization cost, and there's no way to compose several filters (e.g. an obs mask, then a var mask, then a further obs mask) without paying for each step separately.
This matters for the target end-to-end experience as a chain like:
should compose cheaply and only touch data once, at the point something
actually needs values.
Proposed scope
A Selection object that records row/column filters compositionally without touching data until something actually needs values.
VCSCAnnData gains a lazy indexing path that returns a Selection-backed view instead of an eager copy; .compute()/.materialize() (naming TBD) forces it when a caller actually needs a real VCSCAnnData.
Decide how this interacts with the NormalizedView fix as a Selection composed before constructing a NormalizedView is the clean way to guarantee post-selection statistics.
Acceptance criteria
A multi-step subsetting chain (e.g. six filters in sequence) composes in under a millisecond with no data read.
Materializing a composed Selection performs exactly one read, not one per step.
Existing VCSCAnnData indexing behavior (obs/var labels, ints, slices, boolean masks) is preserved for callers that don't opt into laziness.
VCSCAnnData.__getitem__(src/vsparse/_anndata_class.py:154-182) is always an eager copy. This means every subset operation pays a full materialization cost, and there's no way to compose several filters (e.g. an obs mask, then a var mask, then a further obs mask) without paying for each step separately.This matters for the target end-to-end experience as a chain like:
should compose cheaply and only touch data once, at the point something
actually needs values.
Proposed scope
Selectionobject that records row/column filters compositionally without touching data until something actually needs values.VCSCAnnDatagains a lazy indexing path that returns aSelection-backed view instead of an eager copy;.compute()/.materialize()(naming TBD) forces it when a caller actually needs a realVCSCAnnData.NormalizedViewfix as aSelectioncomposed before constructing aNormalizedViewis the clean way to guarantee post-selection statistics.Acceptance criteria
Selectionperforms exactly one read, not one per step.VCSCAnnDataindexing behavior (obs/var labels, ints, slices, boolean masks) is preserved for callers that don't opt into laziness.References
src/vsparse/_anndata_class.py:154-182(class docstring,__getitem__).