treescope.type_registries#
Global registries for adding treescope support to external types.
This module defines global registries which can be used to add treescope support for new types that it does not natively support, or types defined in libraries that may not be installed.
These registries are intended to be used by either the module that defines the
objects being registered, or by treescope
itself. If a type already has
a global registry entry, you should generally avoid modifying it. This is
because the registries are defined as global variables, without a mechanism for
resolving conflicts between multiple entries. If you would like to customize the
rendering of a type that treescope already supports, you should generally either
define your own treescope renderer object and use it directly, or override the
default renderer or autovisualizer (treescope.active_renderer
and
treescope.active_autovisualizer
) using the set_scoped
and set_globally
methods. This will take precedence over any global registry entries.
Functions
|
Checks if an object is marked as immutable in the global registry. |
|
Looks up an NDArray adapter for the given type. |
|
Looks up a treescope handler for the given type. |
Updates registries by running setup logic for newly-imported modules. |
Module Attributes
Global registry of NDArray adapters, keyed by type. |
|
Global registry of custom treescope handlers, keyed by type. |
|
List of abstract base classes that should be checked for virtual subclasses. |
|
Global registry of non-hashable types that are considered immutable. |