Skip to content

Enum Module

mosaicolabs.enum.SerializationFormat

Bases: StrEnum

Defines the structural format used when serializing ontology data for storage or transmission.

The format dictates how the data is organized (e.g., fixed-schema tables vs. variable-length structures) and may imply specific handling during the serialization and deserialization process.

Default class-attribute instance-attribute

Default = 'default'

Represents data that conforms to a strict, fixed-width tabular format (like a standard DataFrame or a PyArrow Table of records). Suitable for simple sensors with a constant number of fields and fixed-size data.

Ragged class-attribute instance-attribute

Ragged = 'ragged'

Represents data containing variable-length lists or sequences (e.g., point clouds, lists of detections, or non-uniform arrays). This format is typically serialized using specialized PyArrow features to handle the non-uniform structure efficiently.

Image class-attribute instance-attribute

Image = 'image'

Represents raw or compressed image data. This format signals that the data consists primarily of a binary blob (the image content) along with associated metadata (width, height, format), often requiring specialized compression/decompression handling.

mosaicolabs.enum.SequenceStatus

Bases: Enum

Represents the operational lifecycle state of a Sequence during the ingestion process (see also SequenceWriter).

This enumeration tracks the state of a sequence from its initial creation through data writing until it reaches a terminal state (Finalized or Error).

Null class-attribute instance-attribute

Null = 'null'

The initial state of a writer before server-side registration.

In this state, the local SequenceWriter instance has been created but the SEQUENCE_CREATE handshake has not yet been performed or completed.

Pending class-attribute instance-attribute

Pending = 'pending'

The sequence is registered on the server and actively accepting data.

This state is entered upon successful execution of the __enter__ method of the SequenceWriter class. While pending, the sequence allows for the creation of new topics and the ingestion of data batches.

Finalized class-attribute instance-attribute

Finalized = 'finalized'

The sequence has been successfully closed and its data is now immutable.

This terminal state indicates that the SequenceWriter._finalize() action was acknowledged by the server. Once finalized, the sequence is typically locked and cannot be deleted unless explicitly unlocked by an administrator.

Error class-attribute instance-attribute

Error = 'error'

The ingestion process failed or was explicitly aborted.

This state is reached if an exception occurs within the with block or during the finalization phase. Depending on the OnErrorPolicy, the data may have been purged (Delete) or retained in an unlocked state for debugging (Report).

mosaicolabs.enum.OnErrorPolicy

Bases: Enum

Defines the behavior of the SequenceWriter when an exception occurs during ingestion.

This policy determines how the platform handles partially uploaded data if the ingestion process is interrupted or fails.

Report class-attribute instance-attribute

Report = 'report'

Notify the server of the error but retain partial data.

The system will attempt to finalize the sequence and notify the server of the specific failure, allowing existing data chunks to remain accessible for inspection.

Lock Status

Unlike standard successful finalization, a sequence finalized via a Report policy is not placed in a locked state. This means the sequence remains mutable at a system level and can be deleted in a later moment once debugging or triage is complete.

Delete class-attribute instance-attribute

Delete = 'delete'

Abort the sequence and instruct the server to discard all data.

This is the default "all-or-nothing" strategy. If a failure occurs, the SequenceWriter will send an abort command to ensure the server purges all traces of the failed ingestion, preventing inconsistent or incomplete sequences from appearing in the catalog.

mosaicolabs.enum.FlightAction

Bases: StrEnum

Internal enumeration of PyArrow Flight action identifiers.

This enum serves as the single source of truth for all action names used in the handshakes between the SDK and the Mosaico server.

Internal Use Only

This class is part of the internal communication protocol. End-users should never need to use these identifiers directly, as they are abstracted by the public methods in MosaicoClient, SequenceWriter, and TopicWriter.

SEQUENCE_CREATE class-attribute instance-attribute

SEQUENCE_CREATE = 'sequence_create'

Initiates the registration of a new sequence on the server.

SEQUENCE_FINALIZE class-attribute instance-attribute

SEQUENCE_FINALIZE = 'sequence_finalize'

Marks a sequence as complete and makes its data immutable.

SEQUENCE_NOTIFY_CREATE class-attribute instance-attribute

SEQUENCE_NOTIFY_CREATE = 'sequence_notify_create'

Sends asynchronous notifications or error reports during the sequence creation phase.

SEQUENCE_NOTIFY_LIST class-attribute instance-attribute

SEQUENCE_NOTIFY_LIST = 'sequence_notify_list'

Request the list of notifications for a specific sequence

SEQUENCE_NOTIFY_PURGE class-attribute instance-attribute

SEQUENCE_NOTIFY_PURGE = 'sequence_notify_purge'

Request the deletion of the list of notifications for a specific sequence

SEQUENCE_SYSTEM_INFO class-attribute instance-attribute

SEQUENCE_SYSTEM_INFO = 'sequence_system_info'

Requests physical diagnostics such as storage size and lock status for a sequence.

SEQUENCE_ABORT class-attribute instance-attribute

SEQUENCE_ABORT = 'sequence_abort'

Signals the server to stop an active ingestion and discard partial data.

SEQUENCE_DELETE class-attribute instance-attribute

SEQUENCE_DELETE = 'sequence_delete'

Requests the permanent removal of a sequence and all associated topics from the server.

TOPIC_CREATE class-attribute instance-attribute

TOPIC_CREATE = 'topic_create'

Registers a new topic within an existing sequence context.

TOPIC_NOTIFY_CREATE class-attribute instance-attribute

TOPIC_NOTIFY_CREATE = 'topic_notify_create'

Reports errors or status updates specific to an individual topic stream.

TOPIC_NOTIFY_LIST class-attribute instance-attribute

TOPIC_NOTIFY_LIST = 'topic_notify_list'

Request the list of notifications for a specific topic in a sequence

TOPIC_NOTIFY_PURGE class-attribute instance-attribute

TOPIC_NOTIFY_PURGE = 'topic_notify_purge'

Request the deletion of the list of notifications for a topic in a sequence

TOPIC_SYSTEM_INFO class-attribute instance-attribute

TOPIC_SYSTEM_INFO = 'topic_system_info'

Requests storage and chunk metadata for an individual topic.

TOPIC_DELETE class-attribute instance-attribute

TOPIC_DELETE = 'topic_delete'

Requests the permanent removal of a specific topic from the platform.

QUERY class-attribute instance-attribute

QUERY = 'query'

Commands a multi-layer search query against the platform.