Endpoint

class ospx.connection.Endpoint(component: Component, connector: Connector | None = None, variable: ScalarVariable | None = None)

Bases: object

Endpoints relate each side of a connection to distinct variables or connectors.

An endpoint is for a connection what a connector is for a component. A connection has two endpoints, one for each side. Connection endpoints are hence the ‘counterparts’ to component’s connectors.

__init__(component: Component, connector: Connector | None = None, variable: ScalarVariable | None = None) None

Methods

__init__(component[, connector, variable])

Attributes

connector

Returns the connector this endpoint refers to, if defined.

is_valid

Consistency check.

variable

Returns the scalar variable this endpoint refers to, if defined.

variable_name

Returns the name of the scalar variable this endpoint refers to.

property connector: Connector | None

Returns the connector this endpoint refers to, if defined.

Returns:

the connector, if defined. Otherwise None.

Return type:

Union[Connector, None]

property is_valid: bool

Consistency check. Returns True if endpoint is defined and valid.

Returns:

True if valid. Otherwise False.

Return type:

bool

property variable: ScalarVariable | None

Returns the scalar variable this endpoint refers to, if defined.

Returns:

the scalar variable, if defined. Otherwise None.

Return type:

Union[ScalarVariable, None]

property variable_name: str

Returns the name of the scalar variable this endpoint refers to.

Returns:

the name of the scalar variable.

Return type:

str