recursive_merge#

niriss_tools.pipeline.recursive_merge(d1, d2)[source]#

Recursively merge two dictionaries.

Values from the second are prioritised in case of conflicts. This code was originally posted on stackoverflow, by Aaron Hall and Bobik.

Parameters:
d1dict

The original dictionary.

d2dict

The new dictionary, which can overwrite values in d1.

Returns:
dict

The merged dictionary.