qudi.util.yaml.YAML
- class qudi.util.yaml.YAML(**kwargs)[source]
Bases:
ruamel.yaml.main.YAMLruamel.yaml.YAML subclass to be used by qudi for all loading/dumping purposes. Will always use the ‘safe’ option without round-trip functionality.
- __init__(**kwargs)[source]
@param kwargs: Keyword arguments accepted by ruamel.yaml.YAML(), excluding “typ”
Methods
Xdump_all(documents, stream, *[, transform])Serialize a sequence of Python objects into a YAML stream.
__init__(**kwargs)@param kwargs: Keyword arguments accepted by ruamel.yaml.YAML(), excluding "typ"
compact([seq_seq, seq_map])compose(stream)Parse the first YAML document in a stream and produce the corresponding representation tree.
compose_all(stream)Parse all YAML documents in a stream and produce corresponding representation trees.
dump(data[, stream, transform])dump_all(documents, stream, *[, transform])emit(events, stream)Emit YAML parsing events into a stream.
get_constructor_parser(stream)the old cyaml needs special setup, and therefore the stream
get_serializer_representer_emitter(stream, tlca)load(stream)at this point you either have the non-pure Parser (which has its own reader and scanner) or you have the pure Parser. If the pure Parser is set, then set the Reader and Scanner, if not already set. If either the Scanner or Reader are set, you cannot use the non-pure Parser, so reset it to the pure parser and set the Reader resp. Scanner if necessary.
load_all(stream)map(**kw)search for list of subdirs that are plug-ins, if __file__ is not available, e.g. single file installers that are not properly emulating a file-system (issue 324) no plug-ins will be found. If any are packaged, you know which file that are and you can explicitly provide it during instantiation: yaml = ruamel.yaml.YAML(plug_ins=['ruamel/yaml/jinja2/__plug_in__']).
parse(stream)Parse a YAML stream and produce parsing events.
register_class(cls)register a class for dumping/loading - if it has attribute yaml_tag use that to register, else use class name - if it has methods to_yaml/from_yaml use those to dump/load else dump attributes as mapping
scan(stream)Scan a YAML stream and produce scanning tokens.
seq(*args)serialize(node, stream)Serialize a representation tree into a YAML stream.
serialize_all(nodes, stream)Serialize a sequence of representation trees into a YAML stream.
Attributes
- Xdump_all(documents: Any, stream: Any, *, transform: Any = None) Any[source]
Serialize a sequence of Python objects into a YAML stream.
- __init__(**kwargs)[source]
@param kwargs: Keyword arguments accepted by ruamel.yaml.YAML(), excluding “typ”
- property block_seq_indent: Any
!! processed by numpydoc !!
- compose(stream: Path | StreamTextType) Any[source]
Parse the first YAML document in a stream and produce the corresponding representation tree.
- compose_all(stream: Path | StreamTextType) Any[source]
Parse all YAML documents in a stream and produce corresponding representation trees.
- property composer: Any
!! processed by numpydoc !!
- property constructor: Any
!! processed by numpydoc !!
- emit(events: Any, stream: Any) None[source]
Emit YAML parsing events into a stream. If stream is None, return the produced string instead.
- property emitter: Any
!! processed by numpydoc !!
- get_constructor_parser(stream: StreamTextType) Any[source]
the old cyaml needs special setup, and therefore the stream
- property indent: Any
!! processed by numpydoc !!
- load(stream: Path | StreamTextType) Any[source]
at this point you either have the non-pure Parser (which has its own reader and scanner) or you have the pure Parser. If the pure Parser is set, then set the Reader and Scanner, if not already set. If either the Scanner or Reader are set, you cannot use the non-pure Parser,
so reset it to the pure parser and set the Reader resp. Scanner if necessary
- official_plug_ins() Any[source]
search for list of subdirs that are plug-ins, if __file__ is not available, e.g. single file installers that are not properly emulating a file-system (issue 324) no plug-ins will be found. If any are packaged, you know which file that are and you can explicitly provide it during instantiation:
yaml = ruamel.yaml.YAML(plug_ins=[‘ruamel/yaml/jinja2/__plug_in__’])
- property parser: Any
!! processed by numpydoc !!
- property reader: Any
!! processed by numpydoc !!
- register_class(cls: Any) Any[source]
register a class for dumping/loading - if it has attribute yaml_tag use that to register, else use class name - if it has methods to_yaml/from_yaml use those to dump/load else dump attributes
as mapping
- property representer: Any
!! processed by numpydoc !!
- property resolver: Any
!! processed by numpydoc !!
- property scanner: Any
!! processed by numpydoc !!
- serialize(node: Any, stream: StreamType | None) Any[source]
Serialize a representation tree into a YAML stream. If stream is None, return the produced string instead.
- serialize_all(nodes: Any, stream: StreamType | None) Any[source]
Serialize a sequence of representation trees into a YAML stream. If stream is None, return the produced string instead.
- property serializer: Any
!! processed by numpydoc !!
- property tags: Any
!! processed by numpydoc !!
- property version: Tuple[int, int] | None
!! processed by numpydoc !!