Skip to content

serialize.space_to_proto

Full path: schola.core.protocols.protobuf.serialize.space_to_proto

schola.core.protocols.protobuf.serialize.space_to_proto

space_to_proto

space_to_proto(space)

Convert a Gymnasium space to a protobuf Space message.

Parameters

space (gym.Space) : The Gymnasium space to convert (e.g., Box, Discrete, Dict, etc.).

Returns

The corresponding protobuf Space message.

Return type: proto_spaces.Space

Raises

  • ValueError - If the space type is not supported.

Notes

This function has multiple registered implementations for different Gymnasium space types (Box, Discrete, MultiDiscrete, MultiBinary, Dict).