fibomat.backend.registry module¶
- class fibomat.backend.registry.Registry[source]¶
Bases:
objectClass 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.- property backends: Dict[str, Type[fibomat.backend.backendbase.BackendBase]]¶
Dict[str, Type[BackendBase]]: registered backends
- register(class_: Type[fibomat.backend.backendbase.BackendBase], name: str) Type[fibomat.backend.backendbase.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
- get(name: str) Type[fibomat.backend.backendbase.BackendBase][source]¶
Returns the registered backend with name name
- Args:
name (str): Name of backend
- Returns:
typing.Type[BackendBase]: Backend class