symbrim.core.registry.Registry¶
- class symbrim.core.registry.Registry(*args: object, **kwargs: dict[str, object])¶
Bases:
Singleton
Registry to keep track of all existing model and connection types in SymBRiM.
Attributes
Return the registered connections.
Return the registered load groups.
Return the registered models.
Methods
Activate the instance of the class.
Deactivate the instance of the class.
Return all models or connections that could be used as property.
Return all models or connections that satisfy the given requirement.
Return all load groups that could be applied to the given object.
Register a new type in the registry.
Register a new load group in the registry.
Register a new type in the registry.
- __weakref__¶
list of weak references to the object (if defined)
- get_from_property(obj: ModelBase | ConnectionBase, prop: str, drop_abstract: bool = True) list[type] ¶
Return all models or connections that could be used as property.
- get_from_requirement(requirement: ConnectionRequirement | ModelRequirement, drop_abstract: bool = True) list[type] ¶
Return all models or connections that satisfy the given requirement.
- Parameters:
requirement (ConnectionRequirement | ModelRequirement) – The requirement to satisfy.
drop_abstract (bool, optional) – Whether to drop abstract classes, by default True.
- Returns:
All models or connections that satisfy the given requirement.
- Return type:
- get_matching_load_groups(obj: ConnectionBase | ModelBase, drop_abstract: bool = True) list[type] ¶
Return all load groups that could be applied to the given object.
- Parameters:
obj (ConnectionBase | ModelBase) – The object to get the load groups from.
drop_abstract (bool, optional) – Whether to drop abstract classes, by default True.
- Returns:
All load groups that could be applied to the given object.
- Return type: