From dde76eddb11b20405a27ebe24a5a0ad1c83b90c8 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 29 Nov 2018 17:30:19 -0800 Subject: [PATCH] Added description of merge_config --- utils/config_ops.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/config_ops.py b/utils/config_ops.py index 0648fe7c..dfdd5558 100644 --- a/utils/config_ops.py +++ b/utils/config_ops.py @@ -57,6 +57,13 @@ def digest_config(obj, kwargs, caller_locals={}): def merge_config(all_dicts): + """ + Creates a dict whose keyset is the union of all the + input dictionaries. The value for each key is based + on the first dict in the list with that key. + + When values are dictionaries, it is applied recursively + """ all_config = reduce(op.add, [list(d.items()) for d in all_dicts]) config = dict() for c in all_config: