phenotypic.tools_.register.register_plotter#

phenotypic.tools_.register.register_plotter(cls: type[BasePlotter]) type[BasePlotter][source]

Decorator to register a plotter class.

The class must have a call_name class attribute that matches the method name for dispatch.

Parameters:

cls (type[BasePlotter]) – Plotter class to register.

Returns:

The registered class (unchanged).

Return type:

type[BasePlotter]

Examples

>>> @register_plotter
... class MyPlotter(BasePlotter):
...     call_name = "my_plot"
...
...     def my_plot(self, **kwargs):
...         ...