changeset 610:e8cb4bde30a7

merge
author Olivier Breuleux <breuleuo@iro.umontreal.ca>
date Fri, 16 Jan 2009 15:53:47 -0500
parents 7cee8c7f0449 (diff) 8f40262297cf (current diff)
children d0c2c33a620f 5a7927691d2c
files pylearn/dbdict/newstuff.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dbdict/newstuff.py	Thu Jan 15 22:23:43 2009 -0500
+++ b/pylearn/dbdict/newstuff.py	Fri Jan 16 15:53:47 2009 -0500
@@ -646,6 +646,8 @@
 
 
 parser_sqlschedule = OptionParser(usage = '%prog sqlschedule [options] <tablepath> <experiment> <parameters>')
+parser_sqlschedule.add_option('-f', '--force', action = 'store_true', dest = 'force', default = False,
+                              help = 'force adding the experiment to the database even if it is already there')
 
 def runner_sqlschedule(options, dbdescr, experiment, *strings):
     """
@@ -697,13 +699,15 @@
     except:
         raise UsageError('The first parameter to sqlschedule must be a valid, importable symbol.')
     state['dbdict.experiment'] = experiment
-    sql.add_experiments_to_db([state], db, verbose = 1)
+    sql.add_experiments_to_db([state], db, verbose = 1, add_dups = options.force)
 
 runner_registry['sqlschedule'] = (parser_sqlschedule, runner_sqlschedule)
 
 
 
 parser_sqlschedule_filemerge = OptionParser(usage = '%prog sqlschedule_filemerge [options] <tablepath> <experiment> <parameters|files>')
+parser_sqlschedule_filemerge.add_option('-f', '--force', action = 'store_true', dest = 'force', default = False,
+                                        help = 'force adding the experiment to the database even if it is already there')
 
 def runner_sqlschedule_filemerge(options, dbdescr, experiment, mainfile, *other_files):
     """
@@ -741,7 +745,7 @@
     except:
         raise UsageError('The first parameter to sqlschedule_filemerge must be a valid, importable symbol.')
     state['dbdict.experiment'] = experiment
-    sql.add_experiments_to_db([state], db, verbose = 1)
+    sql.add_experiments_to_db([state], db, verbose = 1, add_dups = options.force)
 
 runner_registry['sqlschedule_filemerge'] = (parser_sqlschedule_filemerge, runner_sqlschedule_filemerge)