Class: OpenTox::ValidationReport

Inherits:
Object
  • Object
show all
Includes:
OldOpenTox
Defined in:
lib/validation.rb

Instance Attribute Summary

Attributes included from OldOpenTox

#metadata, #uri

Class Method Summary collapse

Methods included from OldOpenTox

#delete, #initialize, #load_metadata

Class Method Details

.create(validation_uri, params = {}, waiting_task = nil) ⇒ OpenTox::ValidationReport

creates a validation report via validation

Parameters:

  • validation_uri (String)

    validation uri

  • params (Hash) (defaults to: {})

    params addiditonal possible (min_confidence, params={}, min_num_predictions, max_num_predictions)

  • waiting_task (OpenTox::Task, optional) (defaults to: nil)

    (can be a OpenTox::Subtask as well), progress is updated accordingly

Returns:


250
251
252
253
254
255
256
257
258
# File 'lib/validation.rb', line 250

def self.create( validation_uri, params={}, waiting_task=nil )
  params = {} if params==nil
  bad_request_error "params is no hash" unless params.is_a?(Hash)
  params[:validation_uris] = validation_uri
  uri = RestClientWrapper.post(File.join($validation[:uri],"/report/validation"),
    params, {}, waiting_task )
  uri = wait_for_task(uri)
  ValidationReport.new(uri)
end

.find(uri) ⇒ OpenTox::ValidationReport

finds ValidationReport via uri, raises error if not found

Parameters:

Returns:


228
229
230
231
232
233
# File 'lib/validation.rb', line 228

def self.find( uri )
  OpenTox::RestClientWrapper.get(uri)
  rep = ValidationReport.new(uri)
  rep.
  rep
end

.find_for_validation(validation_uri) ⇒ OpenTox::ValidationReport

finds ValidationReport for a particular validation

Parameters:

  • validation_uri (String)

    crossvalidation uri

Returns:


238
239
240
241
242
# File 'lib/validation.rb', line 238

def self.find_for_validation( validation_uri )
  uris = RestClientWrapper.get(File.join($validation[:uri],
    "/report/validation?validation="+validation_uri)).chomp.split("\n")
  uris.size==0 ? nil : ValidationReport.new(uris[-1])
end