qudi.util.yaml.SafeRepresenter

class qudi.util.yaml.SafeRepresenter(*args, **kwargs)[source]

Bases: ruamel.yaml.representer.SafeRepresenter

Custom YAML representer for qudi config files

__init__(*args, **kwargs)[source]

Methods

__init__(*args, **kwargs)

add_multi_representer(data_type, representer)

add_representer(data_type, representer)

ignore_aliases(ignore_data)

Ignore aliases and anchors.

represent(data)

represent_binary(data)

represent_bool(data[, anchor])

represent_complex(data)

Representer for builtin complex type

represent_data(data)

represent_date(data)

represent_datetime(data)

represent_dict(data)

represent_dict_no_sort(data)

Representer for dict and OrderedDict to prevent ruamel.yaml from sorting keys

represent_enum(data)

Representer for enum types with base class enum.

represent_flag(data)

Representer for enum types with base class enum.

represent_float(data)

represent_frozenset(data)

Representer for builtin frozenset type

represent_int(data)

represent_key(data)

David Fraser: Extract a method to represent keys in mappings, so that a subclass can choose not to quote them (for example) used in represent_mapping https://bitbucket.org/davidfraser/pyyaml/commits/d81df6eb95f20cac4a79eed95ae553b5c6f77b8c

represent_list(data)

represent_mapping(tag, mapping[, flow_style])

represent_ndarray(data)

Representer for numpy.ndarrays.

represent_none(data)

represent_numpy_complex(data)

Representer for numpy complex scalars

represent_numpy_float(data)

Representer for numpy float scalars

represent_numpy_int(data)

Representer for numpy int scalars

represent_omap(tag, omap[, flow_style])

represent_ordereddict(data)

represent_scalar(tag, value[, style, anchor])

represent_sequence(tag, sequence[, flow_style])

represent_set(data)

represent_str(data)

represent_undefined(data)

represent_yaml_object(tag, data, cls[, ...])

Attributes

inf_value

ndarray_max_size

serializer

yaml_multi_representers

yaml_representers

classmethod add_multi_representer(data_type: Any, representer: Any) None
classmethod add_representer(data_type: Any, representer: Any) None
alias_key: int | None
ignore_aliases(ignore_data)[source]

Ignore aliases and anchors. Overwrites base class implementation.

inf_value = inf
ndarray_max_size = 20
object_keeper: List[Any]
represent(data: Any) None
represent_binary(data: Any) ScalarNode[source]
represent_bool(data: Any, anchor: Any | None = None) ScalarNode[source]
represent_complex(data)[source]

Representer for builtin complex type

represent_data(data: Any) Any
represent_date(data: Any) ScalarNode[source]
represent_datetime(data: Any) ScalarNode[source]
represent_dict(data: Any) MappingNode[source]
represent_dict_no_sort(data)[source]

Representer for dict and OrderedDict to prevent ruamel.yaml from sorting keys

represent_enum(data)[source]

Representer for enum types with base class enum.

represent_flag(data)[source]

Representer for enum types with base class enum.

represent_float(data: Any) ScalarNode[source]
represent_frozenset(data)[source]

Representer for builtin frozenset type

represent_int(data: Any) ScalarNode[source]
represent_key(data: Any) Any

David Fraser: Extract a method to represent keys in mappings, so that a subclass can choose not to quote them (for example) used in represent_mapping https://bitbucket.org/davidfraser/pyyaml/commits/d81df6eb95f20cac4a79eed95ae553b5c6f77b8c

represent_list(data: Any) SequenceNode[source]
represent_mapping(tag: Any, mapping: Any, flow_style: Any = None) MappingNode
represent_ndarray(data)[source]

Representer for numpy.ndarrays. Will represent the array in binary representation as ASCII-encoded string by default. If the output stream to dump to is a “regular” open text file handle (io.TextIOWrapper) and the array size exceeds the specified maximum ndarray size, it is dumped into a separate binary .npy file and is represented in YAML as file path string.

represent_none(data: Any) ScalarNode[source]
represent_numpy_complex(data)[source]

Representer for numpy complex scalars

represent_numpy_float(data)[source]

Representer for numpy float scalars

represent_numpy_int(data)[source]

Representer for numpy int scalars

represent_omap(tag: Any, omap: Any, flow_style: Any = None) SequenceNode
represent_ordereddict(data: Any) SequenceNode[source]
represent_scalar(tag: Any, value: Any, style: Any = None, anchor: Any = None) ScalarNode
represent_sequence(tag: Any, sequence: Any, flow_style: Any = None) SequenceNode
represent_set(data: Any) MappingNode[source]
represent_str(data: Any) Any[source]
represent_undefined(data: Any) None[source]
represent_yaml_object(tag: Any, data: Any, cls: Any, flow_style: Any = None) MappingNode[source]
represented_objects: Dict[Any, Any]
property serializer: Any

!! processed by numpydoc !!

yaml_multi_representers: Dict[Any, Any] = {<class 'numpy.complexfloating'>: <function SafeRepresenter.represent_numpy_complex>, <class 'numpy.floating'>: <function SafeRepresenter.represent_numpy_float>, <class 'numpy.integer'>: <function SafeRepresenter.represent_numpy_int>, <enum 'Enum'>: <function SafeRepresenter.represent_enum>, <enum 'Flag'>: <function SafeRepresenter.represent_flag>, <enum 'IntEnum'>: <function SafeRepresenter.represent_enum>, <enum 'IntFlag'>: <function SafeRepresenter.represent_flag>}
yaml_representers: Dict[Any, Any] = {<class 'NoneType'>: <function SafeRepresenter.represent_none>, <class 'bool'>: <function SafeRepresenter.represent_bool>, <class 'bytes'>: <function SafeRepresenter.represent_binary>, <class 'collections.OrderedDict'>: <function SafeRepresenter.represent_dict_no_sort>, <class 'complex'>: <function SafeRepresenter.represent_complex>, <class 'datetime.date'>: <function SafeRepresenter.represent_date>, <class 'datetime.datetime'>: <function SafeRepresenter.represent_datetime>, <class 'dict'>: <function SafeRepresenter.represent_dict_no_sort>, <class 'float'>: <function SafeRepresenter.represent_float>, <class 'frozenset'>: <function SafeRepresenter.represent_frozenset>, <class 'int'>: <function SafeRepresenter.represent_int>, <class 'list'>: <function SafeRepresenter.represent_list>, <class 'numpy.ndarray'>: <function SafeRepresenter.represent_ndarray>, <class 'ruamel.yaml.compat.ordereddict'>: <function SafeRepresenter.represent_ordereddict>, <class 'set'>: <function SafeRepresenter.represent_set>, <class 'str'>: <function SafeRepresenter.represent_str>, <class 'tuple'>: <function SafeRepresenter.represent_list>, None: <function SafeRepresenter.represent_undefined>}