anndata.experimental.write_dispatched
- anndata.experimental.write_dispatched(store, key, elem, callback, *, dataset_kwargs=mappingproxy({}))
Write elem to store, recusively calling callback at each sub-element.
- Parameters:
- store :
Group
|Group
Union
[Group
,Group
] Storage container to be written to.
- key :
str
Key to write element to. To write to the root group, use “/”.
- elem :
Any
The element to write. Probably an AnnData.
- callback : ((
Array
|Dataset
|Group
|Group
,str
,Any
) →None
,Group
|Group
,str
,Any
,dict
) →None
Callable
[[Callable
[[Union
[Array
,Dataset
,Group
,Group
],str
,Any
],None
],Union
[Group
,Group
],str
,Any
,dict
],None
] Function called when writing each element. See below for signature.
- dataset_kwargs : default:
mappingproxy({})
Keyword arguments to pass to the dataset creation function.
- store :
- Return type:
The callback has the following signature:
write_func (Callable): A callable which takes the in memory element and writes it to the store. This is the default encoding function, and what to call if you don’t want to change behaviour at this level.
store (GroupStorageType): The store to write to.
key (str): The key to write elem into store at. This will be an absolute key.
elem (Any): The element to write.
dataset_kwargs (dict): Keyword arguments to pass to the dataset creation function. This is passed as a keyword argument.
iospec (IOSpec): The specification of the element. This is passed as a keyword argument.
See also