From 3ffb53a01ae8c219f33f650be1472caf743fd19b Mon Sep 17 00:00:00 2001 From: Colin Raffel Date: Fri, 3 Jul 2015 11:32:28 -0400 Subject: [PATCH] Make options and expt_dir args to main.main --- spearmint/main.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spearmint/main.py b/spearmint/main.py index 052bea6..7848aea 100755 --- a/spearmint/main.py +++ b/spearmint/main.py @@ -225,6 +225,9 @@ def get_options(): raise Exception("config.json did not load properly. Perhaps a spurious comma?") options["config"] = commandline_kwargs.config_file + return options, expt_dir + +def main(options, expt_dir): # Set sensible defaults for options options['chooser'] = options.get('chooser', 'default_chooser') @@ -243,11 +246,6 @@ def get_options(): "Aborting.\n" % (expt_dir)) sys.exit(-1) - return options, expt_dir - -def main(): - options, expt_dir = get_options() - resources = parse_resources_from_config(options) # Load up the chooser. @@ -491,4 +489,4 @@ def print_diagnostics(chooser): best_job_fh.close() if __name__ == '__main__': - main() + main(*get_options())