communication.serializer_plugins.numpy module

(De)serialization logic for numpy objects. Used only when ormsgpack.packb(…, option=(ormsgpack.OPT_SERIALIZE_NUMPY, …)) fails.

communication.serializer_plugins.numpy.numpy_deserialize(obj, opts)[source]

Function for serializing numpy object arrays

Parameters:
  • obj (dict[str, Any]) – numpy object to serialize

  • opts (DeserializerOpts) – options to change the behaviour of the serialization.

Return type:

ndarray[tuple[Any, ...], dtype[object_]]

Returns:

deserialized object

communication.serializer_plugins.numpy.numpy_serialize(obj, opts)[source]

Function for serializing numpy object arrays

Parameters:
  • obj (ndarray[tuple[Any, ...], dtype[Any]]) – numpy object to serialize

  • opts (SerializerOpts) – options to change the behaviour of the serialization.

Return type:

dict[str, Any]

Returns:

serialized object

communication.serializer_plugins.numpy.register()[source]

Register numpy serializer and deserializer.

Return type:

None