Skip to content
Snippets Groups Projects
Commit fb5cc996 authored by Lee McCuller's avatar Lee McCuller
Browse files

Merge branch 'inheritance-unset' into 'master'

<unset> removes struct entries with inheritance again

See merge request !148
parents adb7db79 41eabaa2
No related branches found
No related tags found
1 merge request!148<unset> removes struct entries with inheritance again
Pipeline #457163 passed with warnings
......@@ -133,7 +133,11 @@ def load_budget(name_or_path, freq=None, bname=None):
inherit_budget = load_budget(inherit_ifo, freq=freq, bname=bname)
pre_ifo = inherit_budget.ifo
pre_ifo.update(ifo, overwrite_atoms=False)
pre_ifo.update(
ifo,
overwrite_atoms=False,
clear_test=lambda v: isinstance(v, str) and v == '<unset>'
)
inherit_budget.update(ifo=pre_ifo)
return inherit_budget
else:
......
+inherit: 'Aplus'
# test that unset removes struct entries
Optics:
Quadrature: <unset>
\ No newline at end of file
......@@ -36,6 +36,14 @@ def test_inherit_load(pprint, tpath_join, fpath_join):
])
)
fpath3 = fpath_join('Aplus_mod3.yaml')
B_inherit3 = load_budget(fpath3)
pprint(B_inherit3.ifo.diff(B_orig.ifo))
assert(
B_inherit3.ifo.diff(B_orig.ifo)
== [('Optics.Quadrature.dc', None, 1.5707963)]
)
@pytest.mark.fast
@pytest.mark.logic
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment