exa.common.api.proto_serialization.datum.pack

Contents

exa.common.api.proto_serialization.datum.pack#

pack(value)#

Packs a string, numerical value, or an array thereof into protobuf format.

Supported data types are: - str - bool - int, float and complex - Sequences of above. Note that the type of Sequence (list, tuple…) is lost in the conversion. - numeric numpy arrays - None

Parameters:

value (None | bool | str | int | float | complex | ndarray | Sequence) – The piece of data to convert.

Returns:

A protobuf instance that encapsulates value.

Raises:

TypeError in case of unsupported type.

Return type:

iqm.data_definitions.common.v1.data_types_pb2.Datum