camall3n / onager

Lightweight python library for launching experiments and tuning hyperparameters, either locally or on a cluster
MIT License
20 stars 4 forks source link

Passing in no value for the arg raises exception #13

Closed neevparikh closed 4 years ago

neevparikh commented 4 years ago

Reproduce:

thoth prelaunch +command "echo" +jobname echotest +arg --test {2..3} +arg --test1 +arg test2 +tag

Expected: No exception, command runs as if it's a flag. Output:

Traceback (most recent call last):
  File "/home/neev/envs/thoth/bin/thoth", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/neev/repos/thoth/bin/thoth", line 115, in <module>
    meta_launcher.meta_launch(args)
  File "/home/neev/repos/thoth/thoth/meta_launcher.py", line 63, in meta_launch
    value_slot = '-{}' if len(value_list) > 1 or value_list[0] != '' else '{}'
IndexError: list index out of range
neevparikh commented 4 years ago

Fixed by 986bd1d