Closed Lu-ni closed 5 years ago
Note sure what this is for, but your print_param function does not correctly handle many nested levels. Use yaml.dump
instead.
Example:
import yaml
params = {
'pid': {
'kp': 12.,
'ki': 8,
'kd': 42,
'foo': 'bar',
'baz': {
'lol': 21
}
}
}
print(yaml.dump(params, default_flow_style=False))
This is the last improvement listed in #136
@antoinealb won't work because params
are stored as a NestedDict
, a custom class I defined as datamodel that makes it easier to deal with hierarchies. @Lu-ni would need to implement a NestedDict
to dict
converter to use PyYaml :cry:
@antoinealb won't work because params are stored as a NestedDict, a custom class I defined as datamodel that makes it easier to deal with hierarchies. @Lu-ni would need to implement a NestedDict to dict converter to use PyYaml cry
which it turns out is straightforward. NestedDict
derives from defaultdict
(from collections) that converts to dict :tada:
Print the YAML config in the terminal.
ex:
Ready to bake