diff --git a/slate/slate.py b/slate/slate.py index 52401d7..1a16d57 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -78,17 +78,22 @@ class Slate(): return doc, stack raise Exception(f'Unable to find experiment <{name}> in <{filename}>') - def deep_update(self, d, u): + def deep_update(self, d, u, traverse_dot_notation=True): for kstr, v in u.items(): - ks = kstr.split('.') + if traverse_dot_notation: + ks = kstr.split('.') + else: + ks = [kstr] head = d for k in ks: + if k in ['parameters']: + traverse_dot_notation = False last_head = head if k not in head: head[k] = {} head = head[k] if isinstance(v, collections.abc.Mapping): - last_head[ks[-1]] = self.deep_update(d.get(k, {}), v) + last_head[ks[-1]] = self.deep_update(d.get(k, {}), v, traverse_dot_notation=traverse_dot_notation) else: last_head[ks[-1]] = v return d