gluonts.core.serde.flat module#
Flat encoding for serde.
flat.encode always returns a flat dictionary, where keys contain information for nested objects:
class Inner(NamedTuple):
val: int
class Outer(NamedTuple):
inner: Inner
value = Outer(inner=Inner(val=42))
assert encode(value) == {
'()': '__main__.Outer',
'inner.()': '__main__.Inner',
'inner.val': 42},
}
- gluonts.core.serde.flat.clone(data, kwargs=None)[source]#
Create a copy of a given value, by calling encode and decode on it.
If kwargs is provided, it’s possible to overwrite nested values.