Connector

class ospx.connector.Connector(name: str, variable: str | None = None, variable_group: str | None = None, type: str | None = None)

Bases: object

Class representing a connector.

Connectors allow to explicitely make public a components scalar variable or variable group at the component’s outer interface.

An connector is for a component what an endpoint is for a connection. Connectors are hence the ‘counterparts’ to connection’s endpoints.

__init__(name: str, variable: str | None = None, variable_group: str | None = None, type: str | None = None) None

Methods

__init__(name[, variable, variable_group, type])

Attributes

is_group_connector

Returns True if connector is a variable group connector.

is_single_connector

Returns True if connector is a single variable connector.

type

Returns the type of the connector.

variable

Returns the scalar variable this connector is defined for.

variable_group

Returns the variable group this connector is defined for.

variable_name

Returns the name of the variable or variable group this connector is defined for.

property is_group_connector: bool

Returns True if connector is a variable group connector.

Returns:

True if variable group connector. Otherwise False.

Return type:

bool

property is_single_connector: bool

Returns True if connector is a single variable connector.

Returns:

True if single variable connector. Otherwise False.

Return type:

bool

property type: str | None

Returns the type of the connector.

property variable: str | None

Returns the scalar variable this connector is defined for.

Returns:

the scalar variable, if connector is a group connector. Otherwise None.

Return type:

Union[str, None]

property variable_group: str | None

Returns the variable group this connector is defined for.

Returns:

the variable group, if connector is a group connector. Otherwise None.

Return type:

Union[str, None]

property variable_name: str

Returns the name of the variable or variable group this connector is defined for.

Returns:

name of the variable or variable group

Return type:

str