Unexpected keys#10
Conversation
|
@pplantinga, could you please take a look. I'm wondering what are the implications on the existing recipes that use !include (e.g, voicebank) |
|
Thanks for the contribution! However there's still some things we should take a look at and fix before its good to go. First, extra keys still get added if there are any items being passed. For example: f1.yaml f2.yaml Calling: with open("f1.yaml") as f:
load_hyperpyyaml(f, overrides={"seed": 8})results in: The other thing that I'm worried about is potentially missing cases where the overrides should be passed, though I suppose some would argue that this is intended behavior. Same yaml files, but different override call: with open("f1.yaml") as f:
load_hyperpyyaml(f, overrides={"batch_size": 24}, overrides_must_match=False)main branch result: this PR result: I designed it to work the first way because I thought that was more intuitive, but I can see an argument that the opposite is true, and that all overrides must be passed explicitly. If that's the case, we should rewrite this to work that way instead. |
To address this case, when calling HyperPyYAML/hyperpyyaml/core.py Line 306 in 9a36727
As for this, indeed we have different outputs from the main branch and my PR. Main output PR output:
That is also my point of view. I think the PR output makes more sense, since the value of |
|
I think you're right that its better to be explicit in this case. I also think you're probably right that |
|
@pplantinga I agree that it has to be fully tested before the changes are applied. I will try to come up with some test cases and post them here. |
|
Added tests and removed |
Solve the issue I reported in #9 . When interpreting the
!includetag, there is no need to pass theoverridesto it. In fact, I am thinking if it is necessary at all for the_walk_tree_and_resolvefunction to have theoverridesinput, since all the overrides have been handled here, before_walk_tree_and_resolveis called:HyperPyYAML/hyperpyyaml/core.py
Lines 302 to 306 in 9a36727