unilab.base.registry.apply_cfg_overrides¶
- unilab.base.registry.apply_cfg_overrides(target_obj, overrides)[source]¶
Apply a (possibly nested) dict of overrides to
target_objin place.- Behavior:
For each
key, valueinoverrides,target_obj.keymust exist (otherwiseValueError).If
valueis a dict andtarget_obj.keyis already a dataclass instance, recurse into it (deep merge — preserves fields not present invalue). This is what lets Hydra-style partial overrides likeenv.scene.terrain.generator.num_rows=4keepsub_terrainsand other defaults intact.If
valueis a dict andtarget_obj.keyis currentlyNone, instantiate the field’s annotated dataclass type from the dict (full-construction path).Otherwise
setattrthe value directly (scalar / list / non-dataclass).