symbrim.core.requirement.ConnectionRequirement¶
- class symbrim.core.requirement.ConnectionRequirement(attribute_name: str, submodel_types: type | tuple[type, ...], description: str | None = None, hard: bool = True, full_name: str | None = None, type_name: str | None = None)¶
Bases:
RequirementBase
Class representing a requirement for a connection.
Attributes
Name of the attribute that is used to store the object in the parent.
Description of the object.
Full name of the object.
Boolean whether the requirement is a hard requirement.
Type hint for the submodel.
Names of the supported types of the submodel.
Supported types of the submodel.
Methods
Initialize a new instance of the requirement.
Check whether the connection satisfies the requirement.
- __init__(attribute_name: str, submodel_types: type | tuple[type, ...], description: str | None = None, hard: bool = True, full_name: str | None = None, type_name: str | None = None) None ¶
Initialize a new instance of the requirement.
- Parameters:
attribute_name (str) – Name of the attribute that is used to store the object in the parent.
submodel_types (type | tuple[type, ...]) – Supported types of the object.
description (str, optional) – Description of the object, by default None.
hard (bool, optional) – Whether the requirement is hard, i.e. the requirement should be satisfied for the model to be defined, by default True.
full_name (str, optional) – Full name of the object, by default capitalized version of the attribute name, where the underscores are replaced by spaces.
type_name (str, optional) – Names of the supported types of the object. The names of the type classes are used by default.
- __weakref__¶
list of weak references to the object (if defined)