hydra.yaml.model module

A basic YAML representation model. Based on:

https://yaml.org/spec/1.2/spec.html

The Serialization and Presentation properties of YAML, including directives, comments, anchors, style, formatting, and aliases, are not supported by this model. In addition, tags are omitted from this model, and non-standard scalars are unsupported.

class hydra.yaml.model.NodeMapping(value: T)

Bases: Node[Mapping[Node_, Node_]]

A mapping from nodes to nodes

class hydra.yaml.model.NodeScalar(value: T)

Bases: Node[Scalar]

A scalar value

class hydra.yaml.model.NodeSequence(value: T)

Bases: Node[Sequence[Node_]]

A sequence of nodes

class hydra.yaml.model.Node_

Bases: object

NodeMapping | NodeScalar | NodeSequence

MAPPING = Name(value='mapping')
SCALAR = Name(value='scalar')
SEQUENCE = Name(value='sequence')
TYPE_ = Name(value='hydra.yaml.model.Node')
class hydra.yaml.model.Scalar

Bases: object

ScalarBool | ScalarDecimal | ScalarFloat | ScalarInt | ScalarNull | ScalarStr

BOOL = Name(value='bool')
DECIMAL = Name(value='decimal')
FLOAT = Name(value='float')
INT = Name(value='int')
NULL = Name(value='null')
STR = Name(value='str')
TYPE_ = Name(value='hydra.yaml.model.Scalar')
class hydra.yaml.model.ScalarBool(value: T)

Bases: Node[bool]

Represents a true/false value

class hydra.yaml.model.ScalarDecimal(value: T)

Bases: Node[Decimal]

An arbitrary-precision decimal number (lexically a valid JSON number)

class hydra.yaml.model.ScalarFloat(value: T)

Bases: Node[float]

Represents an approximation to real numbers

class hydra.yaml.model.ScalarInt(value: T)

Bases: Node[int]

Represents arbitrary sized finite mathematical integers

class hydra.yaml.model.ScalarNull

Bases: object

Represents the lack of a value

class hydra.yaml.model.ScalarStr(value: T)

Bases: Node[str]

A string value