-
Notifications
You must be signed in to change notification settings - Fork 181
Labels
Description
Please describe your wishes and possible alternatives to achieve the desired result.
This has been attempted in #342 already, and would make a lot of things easier and APIs more generic by default:
- Mainly plotting: Allow using arbitrary vectors in plotting (not only
obscolumns) scanpy#1500 - But also statistical APIs: Allow using arbitrary vectors in plotting (not only
obscolumns) scanpy#1500
I prototyped this functionality with a real-world usecase (reimplementing all Scanpy plotting) here: https://github.com/holoviz-topics/hv-anndata/blob/971789b0e1902ac14ea24b4efcabc894e6d838ec/src/hv_anndata/accessors.py
What we should do differently from the prototype is the holoviews dependency: instead of the ACCESSOR constant, anndata should export a factory that takes an AdPath subclass to implement something like hv-anndata’s current Dimension AdPath:
import holoviews as hv
from anndata.access import AdAc, AdPath
class HvAdPath(AdPath, Dimension):
def __init__(self, *, __repr, __apply, __axes, __label, **params: object) -> None: ...
AdPath.__init__(self, __repr=__repr, __apply=__apply, __axes=__axes, __label=__label)
label_kw = {} if __label is None else dict(label=__label)
Dimension.__init__(self, __repr, **params, **label_kw)
A: AdAc[HvAdPath] = AdAc(HvAdPath)Reactions are currently unavailable