FAIR-Chem/fairchem

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

lbluque opened this issue · 2 comments

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.

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

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