Skip to content
Snippets Groups Projects
Commit 41eabaa2 authored by Kevin Kuns's avatar Kevin Kuns
Browse files

<unset> removes struct entries with inheritance again

parent c606f75b
No related branches found
No related tags found
1 merge request!148<unset> removes struct entries with inheritance again
Pipeline #332702 passed
This commit is part of merge request !148. Comments created here will be created in the context of that merge request.
...@@ -132,7 +132,11 @@ def load_budget(name_or_path, freq=None, bname=None): ...@@ -132,7 +132,11 @@ def load_budget(name_or_path, freq=None, bname=None):
inherit_budget = load_budget(inherit_ifo, freq=freq, bname=bname) inherit_budget = load_budget(inherit_ifo, freq=freq, bname=bname)
pre_ifo = inherit_budget.ifo 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) inherit_budget.update(ifo=pre_ifo)
return inherit_budget return inherit_budget
else: 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): ...@@ -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.fast
@pytest.mark.logic @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