diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-02-17 10:16:35 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-02-17 10:16:35 +0100 |
commit | 2226f9dbba9834e42a2b59c428fc45ea8301288c (patch) | |
tree | b21a33d603106cbcbfe8e95448f2b9da3111bee8 /example.rb | |
parent | 6a45e7eda8b8e4f87ab32d708a77d4aa036b685a (diff) |
adjust to api changes, added tasks
Diffstat (limited to 'example.rb')
-rw-r--r-- | example.rb | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -46,15 +46,19 @@ class Example def self.prepare_example_resources @@summary = "" - delete_all(@@config[:services]["opentox-dataset"]) + #delete_all(@@config[:services]["opentox-dataset"]) + log OpenTox::RestClientWrapper.delete @@config[:services]["opentox-dataset"] log "upload dataset" data = File.read(@@file.path) - data_uri = OpenTox::RestClientWrapper.post @@config[:services]["opentox-dataset"], data, :content_type => "application/rdf+xml" - + task_uri = OpenTox::RestClientWrapper.post @@config[:services]["opentox-dataset"], data, :content_type => "application/rdf+xml" + data_uri = OpenTox::Task.find(task_uri).wait_for_resource + log "train-test-validation" Lib::Validation.auto_migrate! - delete_all(@@config[:services]["opentox-model"]) + #delete_all(@@config[:services]["opentox-model"]) + OpenTox::RestClientWrapper.delete @@config[:services]["opentox-model"] + split_params = Validation::Util.train_test_dataset_split(data_uri, 0.9, 1) v = Validation::Validation.new :training_dataset_uri => split_params[:training_dataset_uri], :test_dataset_uri => split_params[:test_dataset_uri], @@ -121,6 +125,12 @@ class Example end result.gsub!(/\n/, " \\n ") if ($?==0) + if (result.to_s =~ /task/) + log "wait for task: "+result.to_s + task = OpenTox::Task.find(result) + task.wait_for_completion + result = task.resource unless task.failed? + end log "ok ( " +result.to_s[0,50]+" )" suc += 1 else |