From 19eb655f4af1a4631692989a30a59b7b78e6669b Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 20 Apr 2018 10:45:11 +0000 Subject: batch download with original identifiers --- helper.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'helper.rb') diff --git a/helper.rb b/helper.rb index dc4b695..ca20def 100644 --- a/helper.rb +++ b/helper.rb @@ -16,17 +16,14 @@ helpers do end def prediction_to_csv(m,c,p) - #model = Model::Validation.find(m.to_s) model = m model_name = "#{model.endpoint.gsub('_', ' ')} (#{model.species})" model_unit = model.regression? ? "(#{model.unit})" : "" converted_model_unit = model.regression? ? "#{model.unit =~ /\b(mmol\/L)\b/ ? "(mg/L)" : "(mg/kg_bw/day)"}" : "" - #predictions = predictions_ids.collect{|prediction_id| Prediction.find prediction_id} csv = "" - compound = c#Compound.find prediction_object.compound - prediction = p#prediction_object.prediction - #prediction.delete_if{|k,v| k =~ /neighbors|prediction_feature_id/} + compound = c + prediction = p output = {} line = "" output["model_name"] = model_name @@ -123,7 +120,7 @@ helpers do end def dataset_storage - all = Dataset.where(:source => /^tmp/) + all = Batch.where(:source => /^tmp/) out = Hash.new all.reverse.each{|d| out[d.id] = [d.name, d.created_at]} out -- cgit v1.2.3