dict_ops#

deep_merge_missing(dst: Dict[str, Any], src: Dict[str, Any], *, skip_paths: Set[Tuple[str, ...]] | None = None, _path: Tuple[str, ...] = ()) None[source]#

Fill only missing keys in dst from src (recursive), skipping specific subtrees by dotted path. Paths are tuples like (‘binarization’,) or (‘performance’, ‘binarization’).

ensure_path_dict(root: dict, path: tuple[str, ...]) dict[source]#
get_nested(root: Any, path: tuple[str, ...], default: Any = None) Any[source]#
Safe nested dict traversal. Returns default if:
  • any intermediate is not a dict

  • a key is missing

is_under(prefix: tuple[str, ...], path: tuple[str, ...]) bool[source]#

Check if path is under prefix.

Parameters:
  • prefix

  • path

Returns

merge_section_missing_only(section_cfg: Dict[str, Any], section_defaults: Dict[str, Any], *, skip_paths: Set[Tuple[str, ...]] | None = None) bool[source]#
normalise_dict(current: Any) dict[str, Any][source]#
normalize_json_compat(obj: Any) Any[source]#
resolve_path(section: str, path: str) Tuple[str, ...][source]#

Resolve a dotted path. - ‘.channels’ -> (section, ‘channels’) - ‘.performance.bin’ -> (section, ‘performance’, ‘bin’) - ‘vasculature.bin’ -> (‘vasculature’, ‘bin’)