ugly fix: dont traverse dots in sweep config
This commit is contained in:
parent
e926714275
commit
15381955fa
@ -78,17 +78,22 @@ class Slate():
|
|||||||
return doc, stack
|
return doc, stack
|
||||||
raise Exception(f'Unable to find experiment <{name}> in <{filename}>')
|
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():
|
for kstr, v in u.items():
|
||||||
ks = kstr.split('.')
|
if traverse_dot_notation:
|
||||||
|
ks = kstr.split('.')
|
||||||
|
else:
|
||||||
|
ks = [kstr]
|
||||||
head = d
|
head = d
|
||||||
for k in ks:
|
for k in ks:
|
||||||
|
if k in ['parameters']:
|
||||||
|
traverse_dot_notation = False
|
||||||
last_head = head
|
last_head = head
|
||||||
if k not in head:
|
if k not in head:
|
||||||
head[k] = {}
|
head[k] = {}
|
||||||
head = head[k]
|
head = head[k]
|
||||||
if isinstance(v, collections.abc.Mapping):
|
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:
|
else:
|
||||||
last_head[ks[-1]] = v
|
last_head[ks[-1]] = v
|
||||||
return d
|
return d
|
||||||
|
Loading…
Reference in New Issue
Block a user