anndata.acc.ScopeAcc#

class anndata.acc.ScopeAcc[R: AdRef, D: AnnDataLikeMetadataOnly, E = object](*, ref_class, scope=None)[source]#

Bases: RefAcc[R, Never, D, E, E]

Abstract base class for accessors to elements that contain an AnnData-like object.

Accessors for arrays in that object (created via AD) have it as their scope.

Attributes

abstract property AD: AdAcc[R][source]#

Treat the element as a nested AnnData object, e.g. A.uns['a'].AD.obs['x'].

Its repr() is used as the prefix of nested accessors’ repr()s.

scope: ScopeAcc | None = None#

Accessor for the element whose .AD cast this accessor is in, e.g. A.uns['a'] for A.uns['a'].AD.obsm['x'].DF.

If None, this accessor refers into the object passed to get()/set()/isin() itself.

ref_class: type[R]#

Methods

abstractmethod get(data, idx=NO_IDX, /)[source]#

Get the referenced element.

Return type:

E