Class: Retab::ExperimentRun
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ExperimentRun
- Defined in:
- lib/retab/experiment_runs/experiment_run.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow: :workflow, trigger: :trigger, experiment_id: :experiment_id, block_id: :block_id, block_type: :block_type, n_consensus: :n_consensus, lifecycle: :lifecycle, timing: :timing, parent_run_id: :parent_run_id, definition_fingerprint: :definition_fingerprint, documents_fingerprint: :documents_fingerprint, score: :score, total_document_count: :total_document_count, completed_document_count: :completed_document_count, document_count: :document_count, error_count: :error_count }.freeze
Instance Attribute Summary collapse
-
#block_id ⇒ Object
Returns the value of attribute block_id.
-
#block_type ⇒ Object
Returns the value of attribute block_type.
-
#completed_document_count ⇒ Object
Returns the value of attribute completed_document_count.
-
#definition_fingerprint ⇒ Object
Returns the value of attribute definition_fingerprint.
-
#document_count ⇒ Object
Returns the value of attribute document_count.
-
#documents_fingerprint ⇒ Object
Returns the value of attribute documents_fingerprint.
-
#error_count ⇒ Object
Returns the value of attribute error_count.
-
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
-
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
-
#parent_run_id ⇒ Object
Returns the value of attribute parent_run_id.
-
#score ⇒ Object
Returns the value of attribute score.
-
#timing ⇒ Object
Returns the value of attribute timing.
-
#total_document_count ⇒ Object
Returns the value of attribute total_document_count.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
-
#workflow ⇒ Object
Returns the value of attribute workflow.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ExperimentRun
constructor
A new instance of ExperimentRun.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ExperimentRun
Returns a new instance of ExperimentRun.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 48 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @workflow = hash[:workflow] ? Retab::WorkflowSnapshotRef.new(hash[:workflow]) : nil @trigger = hash[:trigger] ? Retab::ExperimentRunTrigger.new(hash[:trigger]) : nil @experiment_id = hash[:experiment_id] @block_id = hash[:block_id] @block_type = hash[:block_type] @n_consensus = hash[:n_consensus] @lifecycle = hash[:lifecycle] ? ( case hash[:lifecycle][:status] when "cancelled" Retab::CancelledWorkflowExperimentRun.new(hash[:lifecycle]) when "completed" Retab::CompletedWorkflowExperimentRun.new(hash[:lifecycle]) when "error" Retab::ErrorWorkflowExperimentRun.new(hash[:lifecycle]) when "pending" Retab::PendingWorkflowExperimentRun.new(hash[:lifecycle]) when "queued" Retab::QueuedWorkflowExperimentRun.new(hash[:lifecycle]) when "running" Retab::RunningWorkflowExperimentRun.new(hash[:lifecycle]) else hash[:lifecycle] end ) : nil @timing = hash[:timing] ? Retab::ExperimentRunTiming.new(hash[:timing]) : nil @parent_run_id = hash[:parent_run_id] @definition_fingerprint = hash[:definition_fingerprint] @documents_fingerprint = hash[:documents_fingerprint] @score = hash[:score] @total_document_count = hash[:total_document_count] @completed_document_count = hash[:completed_document_count] @document_count = hash[:document_count] @error_count = hash[:error_count] end |
Instance Attribute Details
#block_id ⇒ Object
Returns the value of attribute block_id.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def block_id @block_id end |
#block_type ⇒ Object
Returns the value of attribute block_type.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def block_type @block_type end |
#completed_document_count ⇒ Object
Returns the value of attribute completed_document_count.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def completed_document_count @completed_document_count end |
#definition_fingerprint ⇒ Object
Returns the value of attribute definition_fingerprint.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def definition_fingerprint @definition_fingerprint end |
#document_count ⇒ Object
Returns the value of attribute document_count.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def document_count @document_count end |
#documents_fingerprint ⇒ Object
Returns the value of attribute documents_fingerprint.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def documents_fingerprint @documents_fingerprint end |
#error_count ⇒ Object
Returns the value of attribute error_count.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def error_count @error_count end |
#experiment_id ⇒ Object
Returns the value of attribute experiment_id.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def experiment_id @experiment_id end |
#id ⇒ Object
Returns the value of attribute id.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def id @id end |
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def lifecycle @lifecycle end |
#n_consensus ⇒ Object
Returns the value of attribute n_consensus.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def n_consensus @n_consensus end |
#parent_run_id ⇒ Object
Returns the value of attribute parent_run_id.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def parent_run_id @parent_run_id end |
#score ⇒ Object
Returns the value of attribute score.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def score @score end |
#timing ⇒ Object
Returns the value of attribute timing.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def timing @timing end |
#total_document_count ⇒ Object
Returns the value of attribute total_document_count.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def total_document_count @total_document_count end |
#trigger ⇒ Object
Returns the value of attribute trigger.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def trigger @trigger end |
#workflow ⇒ Object
Returns the value of attribute workflow.
28 29 30 |
# File 'lib/retab/experiment_runs/experiment_run.rb', line 28 def workflow @workflow end |