fym.config.register¶
- fym.config.register(d, base=None)[source]¶
Register a configuration.
New in version 1.2.2.
- Parameters
- ddict_like
A configuration dictionary to be registered.
- basestr, optional
Base path to register
d. The path is separated by dots (.), i.e., like"model.quadrotor".
Examples
At each module, the configuration can be registered as follows. In
moduleA.submoduleB:import fym fym.config.register( { "param1": 1, "paramSet.config1": 2, }, base=__name__, )
Then, from any other scripts, the configuration can be called with
load.>>> print(fym.config.load()) { moduleA: { submoduleB: { param1: 1, paramSet: { config1: 2, }, }, }, }