quantlab.core.component.recorded_configs#

quantlab.core.component.recorded_configs(configs)[source]#

Write each component configs names, by id, as the config recorded for it.

Inside the block, get_config() of any component writes a component found in a declared field whose id is a key of configs as that config, at every depth. The components themselves are not changed.

Parameters:
configsMapping[int, dict]

id(component) to the config to write for it.

Examples

>>> dataset = label.config.factor.config.dataset
>>> with recorded_configs({id(dataset): {"name": "x"}}):
...     label.get_config()["factor"]["dataset"]
{'name': 'x'}