Grapher Builder
The grapher_builder module defines the plug-in infrastructure shared by
all graphers. Every grapher must inherit from BaseClass and implement
the required interface; GrapherFactory() discovers and instantiates the
correct subclass at runtime from a plain string name.
Grapher BaseClass
GrapherFactory
- ecosound.visualization.grapher_builder.GrapherFactory(grapher_name, *args, **kwargs)[source]
Grapher Factory.
Loads the grapher class defined by grapher_name. Each grapher class must be added to the __init__.py file.
For example : from .grapher1 import Grapher1
where Grapher1 is the name of the grapher class to load from the .py file grapher1
- Parameters:
grapher_name (str) – Name of the grapher class.
*args (any) – Input arguments for the grapher selected.
**kwargs (any) – Keyword arguments for the grapher selected.
- Raises:
ValueError – If grapher_name doesn’t correspond to any of the graphers available.
- Return type:
Grapher object