From 2d02fabfafccb164093062a962f392bb7d13647a Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Sat, 1 Aug 2015 18:03:09 +0200 Subject: 50 times faster bbrc setup by eliminating @fminer.add_fminer_data --- lib/dataset.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lib/dataset.rb') diff --git a/lib/dataset.rb b/lib/dataset.rb index 38e195b..45f7119 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -5,6 +5,10 @@ module OpenTox class LazarPrediction < Dataset field :creator, type: String + def value compound + end + def confidence compound + end end class DescriptorDataset < Dataset @@ -21,7 +25,6 @@ module OpenTox class Dataset include Mongoid::Document - attr_accessor :bulk attr_writer :data_entries # associations like has_many, belongs_to deteriorate performance @@ -31,11 +34,6 @@ module OpenTox field :source, type: String field :warnings, type: Array, default: [] - def initialize params=nil - super params - @bulk = [] - end - def save_all dump = Marshal.dump(@data_entries) file = Mongo::Grid::File.new(dump, :filename => "#{self.id.to_s}.data_entries") @@ -344,10 +342,8 @@ module OpenTox next elsif numeric[j] @data_entries[i][j] = v.to_f - #dataset.bulk << [cid,feature_ids[j],v.to_f] else @data_entries[i][j] = v.strip - #dataset.bulk << [cid,feature_ids[j],v.strip] end end end @@ -359,7 +355,6 @@ module OpenTox $logger.debug "Value parsing: #{Time.now-time} (Compound creation: #{compound_time})" time = Time.now - #dataset.bulk_write save_all $logger.debug "Saving: #{Time.now-time}" -- cgit v1.2.3