From 69c31b3d16530c369506c6d03e138c6fdccbf155 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Sun, 16 May 2010 17:16:05 +0200 Subject: add check for data when creating new dataset --- lib/dataset.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/dataset.rb') diff --git a/lib/dataset.rb b/lib/dataset.rb index 4099e5e..aea12b5 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -51,6 +51,7 @@ module OpenTox # returns uri of new dataset def create_new_dataset( new_compounds, new_features, new_title, new_creator ) + LOGGER.debug "create new dataset with "+new_compounds.size.to_s+"/"+compounds.size.to_s+" compounds" raise "no new compounds selected" unless new_compounds and new_compounds.size>0 # load require features @@ -68,6 +69,7 @@ module OpenTox # PENDING: why storing feature values in an array? new_compounds.each do |c| data_c = [] + raise "no data for compound '"+c.to_s+"'" if @data[c]==nil @data[c].each do |d| m = {} new_features.each do |f| @@ -75,7 +77,6 @@ module OpenTox end data_c << m end - dataset.data[c] = data_c end return dataset.save -- cgit v1.2.3