-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exp run: Use hydra for parsing --set-param
.
#8067
Conversation
[["foo=baz", "goo=bar"], "{foo: baz, goo: bar, lorem: false}"], | ||
[ | ||
["goo.bag=4"], | ||
"{foo: [bar: 1, baz: 2], goo: {bag: 4}, lorem: false}", | ||
], | ||
[["foo[0]=bar"], "{foo: [bar, baz: 2], goo: {bag: 3}, lorem: false}"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To modify a list, foo[0]=bar must now be passed as foo.0=bar.
[ | ||
["foo[1]=[baz, goo]"], | ||
"{foo: [bar: 1, [baz, goo]], goo: {bag: 3}, lorem: false}", | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting a dictionary to a list is not supported by omegaconf.
@@ -61,6 +51,53 @@ def is_same_type(a, b): | |||
) | |||
|
|||
|
|||
def to_omegaconf(item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these 4 functions had to be added because we try to preserve comments while modifying the params file.
I don't know if this comment-preserving logic was a user request or how relevant it actually is.
For example, YAML spec says:
Comments are a presentation detail and must not have any effect on the serialization tree or representation graph.
In particular, comments are not associated with a particular node.
If we discard the idea of trying to preserve comments we could remove quite a lot of code
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Python support is still pretty buggy but if anything is probably better than before (cc @skshetry) |
7e94025
to
1b186d9
Compare
e988d88
to
90d0457
Compare
24b127f
to
5aa2943
Compare
2db963e
to
d161ff8
Compare
- Overriding a config value : foo.bar=value - Appending a config value : +foo.bar=value - Appending or overriding a config value : ++foo.bar=value - Removing a config value : ~foo.bar, ~foo.bar=value See https://hydra.cc/docs/advanced/override_grammar/basic/#modifying-the-config-object --- Breaking changes: To modify a list, `foo[0]=bar` must now be passed as `foo.0=bar`. Modifying a nested list inside a dictionary is not supported by omegaconf. --- Closes #4883 Closes #5868 Closes #6129
See https://hydra.cc/docs/advanced/override_grammar/basic/#modifying-the-config-object
💣 Breaking changes:
To modify a list,
foo[0]=bar
must now be passed asfoo.0=bar
.Converting a dictionary to a list is not supported by omegaconf.
None of the two were documented.
Closes #4883
Closes #5868
Closes #6129
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.