phenotypic.tools_.register.DashboardRegistry#

class phenotypic.tools_.register.DashboardRegistry[source]

Bases: BaseRegistry

Registry for dashboard classes (duck-typed, no strict base).

Dashboards are registered by their call_name class attribute, which must match the method name used for dispatch (e.g., call_name = "detect_modes" corresponds to image.panel.detect_modes()).

Dashboards may have optional dependencies (e.g., Panel). Classes should only be registered when their dependencies are available.

Methods

__init__

available

Return names of all registered components.

get

Look up registered class by name.

register

Decorator that registers a class by its call_name class attribute.

classmethod available() tuple[str, ...]

Return names of all registered components.

Returns:

Tuple of registered component names, sorted alphabetically.

Return type:

tuple[str, …]

classmethod get(name: str) type[T]

Look up registered class by name.

Parameters:

name (str) – The registered name of the component.

Returns:

The registered class.

Raises:

ValueError – If name is not registered.

Return type:

type[T]

classmethod register(target_cls: type[T]) type[T]

Decorator that registers a class by its call_name class attribute.

If call_name is not defined on the class, defaults to the class name.

Parameters:

target_cls (type[T]) – The class to register.

Returns:

The registered class (unchanged).

Raises:

ValueError – If a component with the same name is already registered.

Return type:

type[T]