phenotypic.tools_.register.PlotterRegistry#

class phenotypic.tools_.register.PlotterRegistry[source]

Bases: BaseRegistry[BasePlotter]

Registry for plotter classes.

Plotters are registered by their call_name class attribute, which must match the method name used for dispatch (e.g., call_name = "overlay" corresponds to image.plot.size_distribution()).

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]