We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
*args
CLI
Add support for *args arguments in CLI
Currently I cannot instantiate *args-like arguments. For example:
In main.py
main.py
from jsonargparse import CLI class A: def __init__(self, *a: int, b: int) -> None: self.a = a self.b = b def main(a: A) -> None: print(a.a, a.b) if __name__ == '__main__': CLI(main)
In config.yaml:
config.yaml
a: class_path: __main__.A init_args: a: [1, 2] b: 3
In terminal:
python -m main --config config.yaml
Gives error:
error: Parser key "a": Problem with given class_path '__main__.A': Validation failed: No action for key "a" to check its value.
The above code should runs without errors.
The text was updated successfully, but these errors were encountered:
Thank you for the proposal! I think about this.
Sorry, something went wrong.
No branches or pull requests
🚀 Feature request
Add support for
*args
arguments inCLI
Motivation
Currently I cannot instantiate
*args
-like arguments. For example:In
main.py
In
config.yaml
:In terminal:
python -m main --config config.yaml
Gives error:
Pitch
The above code should runs without errors.
Alternatives
The text was updated successfully, but these errors were encountered: