Conversation
|
Thanks for the PR, @gleize. |
Co-authored-by: Jasha10 <8935917+Jasha10@users.noreply.github.com>
|
I don't see any problem with adding '-'. |
Only thing that comes to mind is that in the past we thought of potentially adding some basic arithmetic operations, so that you could do something like The same change should be reflected in OmegaConf's grammar. Pay attention to the comments at the top of https://github.com/omry/omegaconf/blob/master/omegaconf/grammar/OmegaConfGrammarParser.g4 |
|
Ok, thanks very much Olivier! @gleize, could you please open a PR against OmegaConf making the same modification to the grammar? |
|
Thanks @Jasha10 for the pointers. |
|
I think ID should not support -. |
One thing I've seen in other libraries to handle the non-pythonic IDs (e.g. Regarding argparse, I'm currently using this fork and haven't had any issue with argparse. But maybe you're thinking about a very specific case where it would fail ? |
Why should IDs be necessarily accessible at runtime via
Note that this PR actually doesn't allow
That's what OmegaConf is doing as well,
Hydra allows some command line parameters starting with |
|
It's a pity the yaml isn't already constrained to python compat ids. |
|
After considering issue #2363, I'm inclined to move forward with this PR as well as with the sister PR omry/omegaconf#880 .
Here's a cross-link to the OmegaConf feature request for arithmetic support: omry/omegaconf#91 . |
Motivation
The override grammar doesn't handle the
'-'character in the ID of groups even though the yaml file does not have this issue.For example, this is perfectly acceptable in the yaml file :
but the override parameter
'models/classifier-heads@head=new_name'throws an error indicating the group ID is incorrect.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
python setup.py antlr.pytest(python 3.8).hydra/grammar/genfolder by newly generated one and tested on my setup similar to the example described above.Related Issues and PRs
N/A