iqm.station_control.client.serializers.sweep_serializers.serialize_sweep_results_chunk

iqm.station_control.client.serializers.sweep_serializers.serialize_sweep_results_chunk#

serialize_sweep_results_chunk(sweep_id, spot_idx, return_parameter, result_value)#

Serialize one sweep result item as a size-delimited protobuf chunk.

The wire format is the standard length-delimited protobuf stream encoding (see https://protobuf.dev/programming-guides/techniques/#streaming): each chunk is varint(len) || SweepResultsChunk.SerializeToString(). The length prefix sits outside the message body, so it must be varint-encoded manually - protobuf only handles varint encoding for fields inside a message. Using a varint for the length prefix is the conventional protobuf framing choice. Chunks are concatenated to form the STREAMING_V2 artifact; the stream is decoded by deserialize_sweep_results_chunks().

Parameters:
  • sweep_id (UUID)

  • spot_idx (int)

  • return_parameter (str)

  • result_value (ndarray)

Return type:

bytes