diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-05-16 17:16:05 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-05-16 17:16:05 +0200 |
commit | 69c31b3d16530c369506c6d03e138c6fdccbf155 (patch) | |
tree | 9a49c5c738745268299f278eef385b8e118d39df /lib/dataset.rb | |
parent | cee11eff66938cb65b817ab9595f4386ce5a8eeb (diff) |
add check for data when creating new dataset
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r-- | lib/dataset.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 |