acton.proto package¶
Submodules¶
acton.proto.io module¶
Functions for reading/writing to protobufs.
-
acton.proto.io.
get_ndarray
(data: list, shape: tuple, dtype: str) → <MagicMock id='139719834441320'>[source]¶ Converts a list of values into an array.
Parameters: - data – Raw array data.
- shape – Shape of the resulting array.
- dtype – Data type of the resulting array.
Returns: Array with the given data, shape, and dtype.
Return type: numpy.ndarray
-
acton.proto.io.
read_metadata
(file: typing.Union[str, typing.BinaryIO]) → bytes[source]¶ Reads metadata from a protobufs file.
Parameters: file – Path to binary file, or file itself. Returns: Metadata. Return type: bytes
-
acton.proto.io.
read_proto
()[source]¶ Reads a protobuf from a .proto file.
Parameters: - path – Path to the .proto file.
- Proto – Protocol message class (from the generated protobuf module).
Returns: The parsed protobuf.
Return type: GeneratedProtocolMessageType
-
acton.proto.io.
read_protos
(file: typing.Union[str, typing.BinaryIO], Proto: <MagicMock id='139719834474424'>) → <MagicMock name='mock()' id='139719834810912'>[source]¶ Reads many protobufs from a file.
Parameters: - file – Path to binary file, or file itself.
- Proto – Protocol message class (from the generated protobuf module).
Yields: GeneratedProtocolMessageType – A parsed protobuf.