summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2012-02-15 15:11:00 +0100
committermr <mr@mrautenberg.de>2012-02-15 15:11:00 +0100
commitf955bce3a9eb0eacdfc9924fa3cd68bbd3127bc8 (patch)
treedd49a9f3feab81ddf2142fa800e4825a6bfb6f2a
parent53836c19a0ad9b293c61a491f646ff46985725a3 (diff)
uncomment code http://goo.gl/ybSy3 after positive test
-rw-r--r--lazar.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lazar.rb b/lazar.rb
index d8cffe0..e4ae4c9 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -152,10 +152,10 @@ post '/:id/?' do
response['Content-Type'] = 'text/uri-list'
if compound_uri
- #cache = PredictionCache.find(:model_uri => lazar.uri, :compound_uri => compound_uri).first
- #if cache and uri_available?(cache.dataset_uri)
- # return cache.dataset_uri
- #else
+ cache = PredictionCache.find(:model_uri => lazar.uri, :compound_uri => compound_uri).first
+ if cache and uri_available?(cache.dataset_uri)
+ return cache.dataset_uri
+ else
begin
prediction_uri = lazar.predict(compound_uri,true,@subjectid).uri
PredictionCache.create(:model_uri => lazar.uri, :compound_uri => compound_uri, :dataset_uri => prediction_uri)
@@ -164,7 +164,7 @@ post '/:id/?' do
LOGGER.error "Lazar prediction failed for #{compound_uri} with #{$!} "
raise "Prediction of #{compound_uri} with #{lazar.uri} failed."
end
- #end
+ end
elsif dataset_uri
task = OpenTox::Task.create("Predict dataset",url_for("/#{lazar.id}", :full)) do |task|
lazar.predict_dataset(dataset_uri, @subjectid, task).uri