NDARRAY_ADAPTER_REGISTRY

NDARRAY_ADAPTER_REGISTRY#

treescope.type_registries.NDARRAY_ADAPTER_REGISTRY: dict[type[Any], ndarray_adapters.NDArrayAdapter[Any]]#

Global registry of NDArray adapters, keyed by type.

The value for a given type should be an instance of NDArrayAdapter, and will be used to render any arrays of that type.

If a type is not present in this registry, the entries of that type’s __mro__ will also be searched. Additionally, virtual base classes will be checked if the abtract base class is in VIRTUAL_BASE_CLASSES.

NDArray adapters are usually looked up using the lookup_ndarray_adapter function, which will also check for the __treescope_ndarray_adapter__ method on the type.