nat.profiler.parameter_optimization.update_helpers#

Functions#

_deep_merge_dict(→ None)

In-place deep merge of nested dictionaries.

nest_updates(→ dict[str, Any])

Convert {'a.b.c': 1, 'd.x.y': 2}

apply_suggestions(→ pydantic.BaseModel)

Return a new config where only the dotted-path keys in flat

Module Contents#

_deep_merge_dict(
target: dict[str, Any],
updates: dict[str, Any],
) None#

In-place deep merge of nested dictionaries.

nest_updates(flat: dict[str, Any]) dict[str, Any]#

Convert {'a.b.c': 1, 'd.x.y': 2}{'a': {'b': {'c': 1}}, 'd': {'x': {'y': 2}}}. Works even when the middle segment is a dict key.

apply_suggestions(
cfg: pydantic.BaseModel,
flat: dict[str, Any],
) pydantic.BaseModel#

Return a new config where only the dotted-path keys in flat have been modified. Preserves all unrelated siblings.