deserialize

qililab.deserialize(string, cls=None)

Deserialize a YAML string to an object.

Parameters:
  • string (str) – The YAML string to deserialize.

  • cls (type[T], optional) – The class type to cast the deserialized object to. Defaults to None.

Raises:

DeserializationError – If deserialization fails or the resulting object is not of the specified type.

Returns:

The deserialized object, optionally cast to the specified class type.

Return type:

Any | T