Skip to content
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

Passing unrecognized arguments to fairchem cli does not raise a useful error #849

Open
lbluque opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request stale

Comments

@lbluque
Copy link
Collaborator

lbluque commented Sep 12, 2024

If I pass an unrecognized argument (or accidentally misspell one, or have one that is no longer supported) I get the following error:

Traceback (most recent call last):
  File "/private/home/lbluque/.micromamba/envs/fairchem/bin/fairchem", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/private/home/lbluque/develop/fairchem/src/fairchem/core/_cli.py", line 70, in main
    config = build_config(args, override_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/home/lbluque/develop/fairchem/src/fairchem/core/common/utils.py", line 514, in build_config
    overrides = create_dict_from_args(args_override)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/home/lbluque/develop/fairchem/src/fairchem/core/common/utils.py", line 398, in create_dict_from_args
    keys_concat, val = arg.removeprefix("--").split("=")
    ^^^^^^^^^^^^^^^^

We should raise an informative error instead.

@lbluque lbluque added the enhancement New feature or request label Sep 17, 2024
Copy link

This issue has been marked as stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 18, 2024
@lbluque lbluque removed the stale label Oct 23, 2024
Copy link

This issue has been marked as stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants