[mlpack-svn] r15526 - mlpack/conf/jenkins-conf/benchmark/benchmark
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jul 22 11:13:37 EDT 2013
Author: marcus
Date: Mon Jul 22 11:13:36 2013
New Revision: 15526
Log:
Handle exception if a module can't be loaded.
Modified:
mlpack/conf/jenkins-conf/benchmark/benchmark/run_benchmark.py
Modified: mlpack/conf/jenkins-conf/benchmark/benchmark/run_benchmark.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/benchmark/run_benchmark.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/benchmark/run_benchmark.py Mon Jul 22 11:13:36 2013
@@ -197,8 +197,12 @@
header.append(name)
# Load script.
- module = Loader.ImportModuleFromPath(script)
- methodCall = getattr(module, method)
+ try:
+ module = Loader.ImportModuleFromPath(script)
+ methodCall = getattr(module, method)
+ except Exception, e:
+ Log.Fatal("Could not load the script: " + script)
+ continue
for dataset in datsets:
datasetName = NormalizeDatasetName(dataset)
@@ -209,9 +213,14 @@
modifiedDataset = GetDataset(dataset, format)
+ try:
+ instance = methodCall(modifiedDataset[0], verbose=False)
+ except Exception, e:
+ Log.Fatal("Could not call the constructor: " + script)
+ continue
+
time = 0
for trial in range(trials + 1):
- instance = methodCall(modifiedDataset[0], verbose=False)
if trial > 0:
time += instance.RunMethod(options);
More information about the mlpack-svn
mailing list