openforcefield / openff-benchmark

Comparison benchmarks between public force fields and Open Force Field Initiative force fields
MIT License
11 stars 2 forks source link

`openff-benchmark` CLI help broken by logging config #54

Closed dotsdl closed 3 years ago

dotsdl commented 3 years ago

The logging configuration attempting to use sys.argv as the filename breaks the CLI when used without a 2-deep subcommand:

# broken
$ openff-benchmark
Traceback (most recent call last):
  File "/home/david/.conda/envs/openff-benchmark-optimization/bin/openff-benchmark", line 7, in <module>
    from openff.benchmark.cli import cli
  File "/home/david/.conda/envs/openff-benchmark-optimization/lib/python3.7/site-packages/openff/benchmark/cli.py", line 28, in <module>
    logging.basicConfig(filename=f'{sys.argv[2]}.log',
IndexError: list index out of range
# broken
$ openff-benchmark optimize
Traceback (most recent call last):
  File "/home/david/.conda/envs/openff-benchmark-optimization/bin/openff-benchmark", line 7, in <module>
    from openff.benchmark.cli import cli
  File "/home/david/.conda/envs/openff-benchmark-optimization/lib/python3.7/site-packages/openff/benchmark/cli.py", line 28, in <module>
    logging.basicConfig(filename=f'{sys.argv[2]}.log',
IndexError: list index out of range
# works fine
$ openff-benchmark optimize execute
Usage: openff-benchmark optimize execute [OPTIONS] [INPUT_PATHS]...
Try 'openff-benchmark optimize execute --help' for help.

Error: Missing option '-s' / '--season'.

Will address with conditional logic.

dotsdl commented 3 years ago

Closed by #55.