openpectus.protocol.engine_messages

Classes

EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

EngineControlMessage

Base class for protocol messages for both REST and WebSocket communication.

EngineDataMessage

Base class for protocol messages for both REST and WebSocket communication.

PingMsg

Base class for protocol messages for both REST and WebSocket communication.

RegisterEngineMsg

Doesn't extend EngineMessage, because we don't have the engine_id yet

UodInfoMsg

Base class for protocol messages for both REST and WebSocket communication.

TagsUpdatedMsg

Base class for protocol messages for both REST and WebSocket communication.

TagsBufferedMsg

Base class for protocol messages for both REST and WebSocket communication.

RunLogMsg

Base class for protocol messages for both REST and WebSocket communication.

ErrorLogMsg

Base class for protocol messages for both REST and WebSocket communication.

MethodMsg

Base class for protocol messages for both REST and WebSocket communication.

MethodStateMsg

Base class for protocol messages for both REST and WebSocket communication.

ControlStateMsg

Base class for protocol messages for both REST and WebSocket communication.

RunStartedMsg

Base class for protocol messages for both REST and WebSocket communication.

RunStoppedMsg

Base class for protocol messages for both REST and WebSocket communication.

WebPushNotificationMsg

Base class for protocol messages for both REST and WebSocket communication.

Functions

print_sequence_range(messages)

print message sequence numbers in concise format

Module Contents

class openpectus.protocol.engine_messages.EngineMessage(/, **data)

Bases: openpectus.protocol.messages.MessageBase

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

sequence_number: int = -1
engine_id: str = ''
property ident: str
Return type:

str

__str__()
Return type:

str

class openpectus.protocol.engine_messages.EngineControlMessage(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

class openpectus.protocol.engine_messages.EngineDataMessage(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

class openpectus.protocol.engine_messages.PingMsg(/, **data)

Bases: EngineControlMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

class openpectus.protocol.engine_messages.RegisterEngineMsg(/, **data)

Bases: openpectus.protocol.messages.MessageBase

Doesn’t extend EngineMessage, because we don’t have the engine_id yet

Parameters:

data (Any)

computer_name: str
uod_name: str
uod_author_name: str
uod_author_email: str
uod_filename: str
location: str
engine_version: str
secret: str = ''
sequence_number: int = -2
property ident: str
Return type:

str

__str__()
Return type:

str

class openpectus.protocol.engine_messages.UodInfoMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

readings: list[openpectus.protocol.models.ReadingInfo]
commands: list[openpectus.protocol.models.CommandInfo]
uod_definition: openpectus.protocol.models.UodDefinition
plot_configuration: openpectus.protocol.models.PlotConfiguration
hardware_str: str
required_roles: set[str]
data_log_interval_seconds: float
__str__()
Return type:

str

class openpectus.protocol.engine_messages.TagsUpdatedMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

tags: list[openpectus.protocol.models.TagValue] = []
__str__()
Return type:

str

class openpectus.protocol.engine_messages.TagsBufferedMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

tags: list[openpectus.protocol.models.TagValue] = []
tick_time: float
__str__()
Return type:

str

class openpectus.protocol.engine_messages.RunLogMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

id: str
run_id: str
runlog: openpectus.protocol.models.RunLog
__str__()
Return type:

str

class openpectus.protocol.engine_messages.ErrorLogMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

log: openpectus.protocol.models.ErrorLog
__str__()
Return type:

str

class openpectus.protocol.engine_messages.MethodMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

method: openpectus.protocol.models.Method
__str__()
Return type:

str

class openpectus.protocol.engine_messages.MethodStateMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

method_state: openpectus.protocol.models.MethodState
__str__()
Return type:

str

class openpectus.protocol.engine_messages.ControlStateMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

control_state: openpectus.protocol.models.ControlState
__str__()
Return type:

str

class openpectus.protocol.engine_messages.RunStartedMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

run_id: str
started_tick: float
__str__()
Return type:

str

class openpectus.protocol.engine_messages.RunStoppedMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

run_id: str
runlog: openpectus.protocol.models.RunLog
method_state: openpectus.protocol.models.MethodState
archive: str | None
archive_filename: str | None
__str__()
Return type:

str

class openpectus.protocol.engine_messages.WebPushNotificationMsg(/, **data)

Bases: EngineMessage

Base class for protocol messages for both REST and WebSocket communication.

These inherit from pydantic BaseModel to support automatic (de-)serialization when sent over fastapi_websocket_pubsub. Additionally they support automatic openapi schema generation for use with REST.

Unfortunately, for websocket rpc, (de-)serialization is not automatic but is handled using the openpectus.protocol.serialization module.

Parameters:

data (Any)

notification: openpectus.aggregator.models.WebPushNotification
topic: openpectus.aggregator.models.NotificationTopic
__str__()
openpectus.protocol.engine_messages.print_sequence_range(messages)

print message sequence numbers in concise format

Parameters:

messages (Sequence[EngineMessage])

Return type:

str