Open slerman12 opened 2 years ago
Hi @slerman12,
I think this touches on the limitations of OmegaConf's ${}
interpolation.
Unfortunately I'm not aware of a workaround to achieve what you've indicated.
Edit: I was surprised to find that the same issue does not happen using pure OmegaConf:
>>> cfgA = OmegaConf.create({"block1": {"arg1": 1, "arg2": 2}, "block2": "${block1}"})
>>> cfgB = OmegaConf.create({"block2": {"arg3": 3}})
>>> OmegaConf.merge(cfgA, cfgB)
{'block1': {'arg1': 1, 'arg2': 2}, 'block2': {'arg1': 1, 'arg2': 2, 'arg3': 3}}
My instinct would be to regard this as a Hydra bug (and change Hydra to allow merging into interpolations like you've suggested).
Let's say I have two blocks, where one block depends on the other:
Now I launch my program as
python launch.py +block2.arg3=3
If I print block2, I get:
{'arg3': 3}
However, I would like to get:
{'arg1': 1, 'arg2': 2, 'arg3': 3}