merge_dict#

ansys.aedt.core.modules.profile.merge_dict(d1: dict, d2: dict) dict#

Recursively merge two dictionaries using type-aware rules.

The merge follows these rules when a key exists in both:

  • Identical values: keep that value.

  • Both dict: merge recursively with the same algorithm.

  • Both list: concatenate and return a sorted list.

  • Both str: concatenate separated by a newline.

  • Different or otherwise incompatible types: preserve the value from

d1 under the original key and store the value from d2 under "<key>_2".

Keys that exist in only one dictionary are copied as-is. Keys are ordered using a natural sort that extracts a trailing integer.

Parameters:
d1dict
d2dict
Returns:
dict
Merged dictionary.