diff options
author | mguetlein <martin.guetlein@gmail.com> | 2013-08-09 12:06:25 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2013-08-09 12:06:25 +0200 |
commit | 4f1fc786fa8b10cff0aad3ee1ce8965b8db4e755 (patch) | |
tree | 989702db6c5f96479bd54846b4975e8c117fb45b | |
parent | 701d5562d4f30b2047046728effd3b265db68440 (diff) |
adjust validation to ruby2.0 and to client-API changes
-rw-r--r-- | lib/prediction_data.rb | 4 | ||||
-rwxr-xr-x | lib/validation_db.rb | 2 | ||||
-rwxr-xr-x | report/report_persistance.rb | 2 | ||||
-rwxr-xr-x | validation/validation_service.rb | 8 |
4 files changed, 7 insertions, 9 deletions
diff --git a/lib/prediction_data.rb b/lib/prediction_data.rb index 9450a5b..c7b5bc1 100644 --- a/lib/prediction_data.rb +++ b/lib/prediction_data.rb @@ -141,8 +141,8 @@ module Lib if CHECK_VALUES prediction_dataset.compounds.size.times do |c_idx| c = prediction_dataset.compounds[c_idx] - internal_server_error "predicted compound not found in test dataset:\n"+c.uri+"\ntest-compounds:\n"+ - test_dataset.compounds.collect{|c| c.uri}.join("\n") if prediction_dataset.data_entry_value(c_idx,predicted_variable)!=nil and test_dataset.compounds.include?(c) + internal_server_error "predicted compound #{c.uri}\nfrom prediction dataset #{prediction_dataset.uri}\nnot found in test-dataset #{test_dataset.uri}\ntest-compounds:\n"+ + test_dataset.compounds.collect{|c| c.uri}.join("\n") if prediction_dataset.data_entry_value(c_idx,predicted_variable)!=nil and !test_dataset.compounds.include?(c) end end diff --git a/lib/validation_db.rb b/lib/validation_db.rb index ecc0693..ea9ceba 100755 --- a/lib/validation_db.rb +++ b/lib/validation_db.rb @@ -119,7 +119,7 @@ module Validation def save super - OpenTox::Authorization.check_policy(validation_uri, OpenTox::RestClientWrapper.subjectid) + OpenTox::Authorization.check_policy(validation_uri) end public diff --git a/report/report_persistance.rb b/report/report_persistance.rb index 60fd454..588835e 100755 --- a/report/report_persistance.rb +++ b/report/report_persistance.rb @@ -243,7 +243,7 @@ module Reports internal_server_error "report meta data missing" unless meta_data meta_data[:report_type] = type report = ReportData.create(meta_data) - OpenTox::Authorization.check_policy(report.report_uri, OpenTox::RestClientWrapper.subjectid) + OpenTox::Authorization.check_policy(report.report_uri) new_report_with_id(report_content, type, report.id) end diff --git a/validation/validation_service.rb b/validation/validation_service.rb index 67009df..25931ce 100755 --- a/validation/validation_service.rb +++ b/validation/validation_service.rb @@ -164,9 +164,8 @@ module Validation internal_server_error "validation_type missing" unless self.validation_type $logger.debug "validating model '"+self.model_uri+"'" - #model = OpenTox::Model::PredictionModel.find(self.model_uri) - #resource_not_found_error "model not found: "+self.model_uri.to_s unless model - model = OpenTox::Model::Generic.new(self.model_uri) + model = OpenTox::Model::Generic.find(self.model_uri) + resource_not_found_error "model not found: "+self.model_uri.to_s unless model unless self.algorithm_uri self.algorithm_uri = model.metadata[RDF::OT.algorithm] @@ -213,8 +212,7 @@ module Validation end def compute_prediction_data_with_model(model=nil, task=nil) - #model = OpenTox::Model::Generic.find(self.model_uri, self.subjectid) if model==nil and self.model_uri - model = OpenTox::Model.find(self.model_uri) if model==nil and self.model_uri + model = OpenTox::Model::Generic.find(self.model_uri) if model==nil and self.model_uri resource_not_found_error "model not found: "+self.model_uri.to_s unless model feature_type = model.feature_type |