s-goldman / Dusty-Evolved-Star-Kit

SED-fitting python package for fitting evolved stars
https://dusty-evolved-star-kit.readthedocs.io
Other
15 stars 2 forks source link

AssertionError if no arguments passed #165

Closed TomGoffrey closed 3 years ago

TomGoffrey commented 3 years ago

Describe the bug Invoking desk from the command line without any option raises an AssertionError

To Reproduce

$ desk
Traceback (most recent call last):
  File "/usr/local/bin/desk", line 8, in <module>
    sys.exit(main())
  File "/Users/tom/dev/Dusty-Evolved-Star-Kit/desk/main.py", line 36, in main
    assert False, "Invalid subparser! This should be impossible..."
AssertionError: Invalid subparser! This should be impossible...

If you suspect this is an IPython 7.12.0 bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

Expected behavior

Perhaps the most sensible thing here would be to return the same as desk --help?

Screenshots

Additional context

TomGoffrey commented 3 years ago

It looks like the case of an invalid argument is handled correctly though:

desk abc
usage: desk [-h] {fit,grids,save_model,sed,sed_indiv,version} ...
desk: error: argument subparser_name: invalid choice: 'abc' (choose from 'fit', 'grids', 'save_model', 'sed', 'sed_indiv', 'version')