yaml_utils ========== .. py:module:: quantify_scheduler.yaml_utils .. autoapi-nested-parse:: Module containing quantify YAML utilities. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.yaml_utils.YAMLSerializable Attributes ~~~~~~~~~~ .. autoapisummary:: quantify_scheduler.yaml_utils.yaml .. py:data:: yaml .. py:class:: YAMLSerializable Mixin to allow (de)serialization of instruments from/to YAML. NOTE: Only works with ``Instrument`` subclasses, for others use `@yaml.register_class`. NOTE: `to_yaml` and `from_yaml` methods cannot be created because they would be found and used by the ``ruamel.yaml`` representers and constructors. .. py:method:: to_yaml_file(path: str | pathlib.Path | None = None, add_timestamp: bool = True) -> str Convert the object's data structure to a YAML string and store it in a file. :param path: The path to the directory where the file is created. Default is `None`, in which case the file will be saved in the directory determined by :func:`~quantify_core.data.handling.get_datadir()`. :param add_timestamp: Specify whether to append timestamp to the filename. Default is True. :returns: The name of the file containing the serialized object. .. py:method:: from_yaml_file(filename: str | pathlib.Path) -> typing_extensions.Self :classmethod: Read YAML data from a file and convert it to an instance of the attached class. :param filename: The name of the file containing the serialized object. :returns: The deserialized object.