fibomat.backend.registry module#

class fibomat.backend.registry.Registry[source]#

Bases: object

Class is used to register and store backends for exporting.

Usually, you do not have to create an instance yourself and you rather should use the predefined instance registry.

__init__()[source]#
property backends: Dict[str, Type[BackendBase]]#

Dict[str, Type[BackendBase]]: registered backends

register(class_: Type[BackendBase], name: str) Type[BackendBase][source]#

Register the the backend class class_ with name name. name has to be used in get() to retrieve the backend class.

Note

name can by arbitrary and any other registered backend with the same name gets overwritten.

Args:

class_ (typing.Type[BackendBase]): backend class to be registered name (str): name of the backend

Raises:
TypeError: Raised if class_ is not a subclass of

BackendBase.

get(name: str) Type[BackendBase][source]#

Returns the registered backend with name name

Args:

name (str): Name of backend

Returns:

typing.Type[BackendBase]: Backend class

fibomat.backend.registry.registry = <fibomat.backend.registry.Registry object>#

Registry instance