From 807b87cf18b42c055e62c91e31b05a728a7fdd42 Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 29 Jul 2019 14:53:44 +0000 Subject: optimize batch table size; mute task progress js functions --- application.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'application.rb') diff --git a/application.rb b/application.rb index f5f3486..fa2a728 100644 --- a/application.rb +++ b/application.rb @@ -157,7 +157,9 @@ get '/predict/batch/download/?' do dataset = Dataset.find task.dataset_id name = dataset.name + ".csv" t = Tempfile.new - t << dataset.to_prediction_csv + # to_prediction_csv takes too much time; use task.csv instead which is the same + #t << dataset.to_prediction_csv + t << task.csv t.rewind response['Content-Type'] = "text/csv" send_file t.path, :filename => "#{Time.now.strftime("%Y-%m-%d")}_lazar_batch_prediction_#{name}", :type => "text/csv", :disposition => "attachment" @@ -253,21 +255,21 @@ get '/prediction/task/?' do cansmi = 0 header.each_with_index do |h,idx| cansmi = idx if h =~ /Canonical SMILES/ - string += "#{h}" + string += "#{h}" end string += "" string += "" csv[pageNumber].each_with_index do |line,idx| if idx == cansmi c = Compound.from_smiles line - string += "#{line}
" \ + string += "#{line}
" \ "" \ "#{embedded_svg(c.svg, title: "click for details")}" \ "" else - string += "#{line.numeric? && line.include?(".") ? line.to_f.signif(3) : line}" + string += "#{line.numeric? && line.include?(".") ? line.to_f.signif(3) : (line.nil? ? line : line.gsub(" ","
"))}" end end string += "" -- cgit v1.2.3