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

Invalid arguments should cause prelaunch script to fail with an error #27

Open camall3n opened 4 years ago

camall3n commented 4 years ago

For example, if ++append is used instead of +append, instead of giving an error, it silently truncates the file.

$ onager prelaunch +arg --foo 1 2 +arg --bar a b +command "./examples/myscript" +jobname test
$ onager prelaunch +arg --foo 7 +arg --bar a b c +command "./examples/myscript" +jobname test ++append
$ cat .onager/scripts/test/jobs.json

Expected output:

{
"1": ["./examples/myscript --foo 1 --bar a --tag test_1__foo_1__bar_a", "test_1__foo_1__bar_a"],
"2": ["./examples/myscript --foo 1 --bar b --tag test_2__foo_1__bar_b", "test_2__foo_1__bar_b"],
"3": ["./examples/myscript --foo 2 --bar a --tag test_3__foo_2__bar_a", "test_3__foo_2__bar_c"],
"4": ["./examples/myscript --foo 2 --bar b --tag test_4__foo_2__bar_b", "test_4__foo_2__bar_c"],
"5": ["./examples/myscript --foo 7 --bar a --tag test_5__foo_7__bar_a", "test_5__foo_7__bar_a"],
"6": ["./examples/myscript --foo 7 --bar b --tag test_6__foo_7__bar_b", "test_6__foo_7__bar_b"],
"7": ["./examples/myscript --foo 7 --bar c --tag test_7__foo_7__bar_c", "test_7__foo_7__bar_c"]
}

Actual output:

{
"1": ["./examples/myscript --foo 7 --bar a --tag test_1__foo_7__bar_a", "test_1__foo_7__bar_a"],
"2": ["./examples/myscript --foo 7 --bar b --tag test_2__foo_7__bar_b", "test_2__foo_7__bar_b"],
"3": ["./examples/myscript --foo 7 --bar c --tag test_3__foo_7__bar_c", "test_3__foo_7__bar_c"]
}
neevparikh commented 4 years ago

Should this be closed?

camall3n commented 4 years ago

Sorry, wrong label. It's an invalid argument, not an invalid issue

camall3n commented 4 years ago

I updated the initial post to show the expected output.

camall3n commented 3 years ago

Possibly related to #34