fixed minor inconsistencies in the code (naming of new variables etc.)
authorFabio <fabio@congo.fml.local>
Sat, 13 Sep 2008 19:33:57 +0000 (21:33 +0200)
committerFabio <fabio@congo.fml.local>
Sat, 13 Sep 2008 19:33:57 +0000 (21:33 +0200)
qpalma/DatasetUtils.py
qpalma/SettingsParser.py
qpalma/gridtools.py
scripts/qpalma_pipeline.py

index f9c1c34..31a156e 100644 (file)
@@ -154,8 +154,8 @@ def saveData(prefix,dataset,settings):
    else:
       assert False
 
-   assert not os.path.exists(dataset_fn), 'The data file already exists!'
-   assert not os.path.exists(dataset_keys_fn), 'The data keys file already exists!'
+   #assert not os.path.exists(dataset_fn), 'The data file already exists!'
+   #assert not os.path.exists(dataset_keys_fn), 'The data keys file already exists!'
 
    # saving new dataset and single keys as well
    cPickle.dump(dataset,open(dataset_fn,'w+'),protocol=2)
index ac66128..65c9824 100644 (file)
@@ -53,13 +53,14 @@ def makeSettings(settings):
       except:
          print ('Error: There was a problem generating the subdirectory: %s' % dir_name)
 
+   assert checkSettings(settings),'Check your settings some entries were invalid!'
+
    ddir = settings['dataset_dir']
    settings['prediction_dataset_fn']      = jp(ddir,'prediction_data.pickle')
    settings['prediction_dataset_keys_fn'] = jp(ddir,'prediction_data.keys.pickle')
    settings['training_dataset_fn']        = jp(ddir,'training_data.pickle')
    settings['training_dataset_keys_fn']   = jp(ddir,'training_data.keys.pickle')
 
-
    try:
       os.mkdir(settings['global_log_fn'])
    except:
@@ -89,6 +90,4 @@ def checkSettings(settings):
 def parseSettings(filename):
    settings = parseSettingsFile(filename)
    settings = makeSettings(settings)
-   assert checkSettings(settings),'Check your settings some entries were invalid!'
-
    return settings
index 40282a8..e3dddcd 100644 (file)
@@ -181,7 +181,7 @@ class AlignmentTask(ClusterTask):
       ClusterTask.__init__(self,settings)
 
 
-   def CreateJobs():
+   def CreateJobs(self):
       """
 
       """
@@ -190,14 +190,14 @@ class AlignmentTask(ClusterTask):
 
       jp = os.path.join
 
-      run   = cPickle.load(open(settings['run_fn']))
+      run   = cPickle.load(open(self.settings['run_fn']))
       run['name'] = 'saved_run'
 
-      param = settings['prediction_parameter_fn']
+      param = self.settings['prediction_parameter_fn']
 
-      run['result_dir']    = settings['prediction_dir']
-      dataset_fn           = settings['prediction_dataset_fn']
-      prediction_keys_fn   = settings['prediction_dataset_keys_fn']
+      run['result_dir']    = self.settings['prediction_dir']
+      dataset_fn           = self.settings['prediction_dataset_fn']
+      prediction_keys_fn   = self.settings['prediction_dataset_keys_fn']
 
       prediction_keys = cPickle.load(open(prediction_keys_fn))
 
@@ -211,7 +211,7 @@ class AlignmentTask(ClusterTask):
             chunks.append((c_name,prediction_keys[slice[0]:slice[1]]))
 
       for c_name,current_chunk in chunks:
-         current_job = KybJob(grid_predict.TaskStarter,[run,dataset_fn,current_chunk,param,c_name])
+         current_job = KybJob(gridtools.TaskStarter,[run,dataset_fn,current_chunk,param,c_name])
          current_job.h_vmem = '20.0G'
          #current_job.express = 'True'
 
@@ -223,18 +223,18 @@ class AlignmentTask(ClusterTask):
       for size in [len(elem) for name,elem in chunks]:
          sum += size
       
-      print 'Got %d job(s)' % len(functionJobs)
+      print 'Got %d job(s)' % len(self.functionJobs)
 
 
-   def TaskStarter(run,dataset_fn,prediction_keys,param,set_name):
-      """
-     
-      """
+def TaskStarter(run,dataset_fn,prediction_keys,param,set_name):
+   """
+  
+   """
 
-      qp = QPalma()
-      qp.predict(run,dataset_fn,prediction_keys,param,set_name)
+   qp = QPalma()
+   qp.predict(run,dataset_fn,prediction_keys,param,set_name)
 
-      return 'finished prediction of set %s.' % set_name
+   return 'finished prediction of set %s.' % set_name
 
 
 
index 3803714..5bb4af1 100644 (file)
@@ -23,7 +23,7 @@ from qpalma.gridtools import AlignmentTask,PostprocessingTask
 
 from qpalma.DatasetUtils import generatePredictionDataset,generateTrainingDataset
 
-from SettingsParser import parseSettings
+from qpalma.SettingsParser import parseSettings
 
 
 Errormsg = """Usage is: python qpalma_pipeline.py <config filename>"""