Class: Ace::Sim::Molecules::SynthesisBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/sim/molecules/synthesis_builder.rb

Instance Method Summary collapse

Instance Method Details

#build(session:, sources:, chains:, final_stage: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ace/sim/molecules/synthesis_builder.rb', line 7

def build(session:, sources:, chains:, final_stage: nil)
  {
    "run_id" => session.run_id,
    "preset" => session.preset,
    "sources" => sources,
    "providers" => session.providers,
    "repeat" => session.repeat,
    "dry_run" => session.dry_run?,
    "writeback" => session.writeback,
    "synthesis_workflow" => session.synthesis_workflow,
    "synthesis_provider" => session.synthesis_provider,
    "chains" => chains,
    "final_stage" => final_stage,
    "status" => overall_status(chains, final_stage: final_stage)
  }
end

#chain_status(step_results) ⇒ Object



24
25
26
# File 'lib/ace/sim/molecules/synthesis_builder.rb', line 24

def chain_status(step_results)
  (step_results.any? { |step| step["status"] == "failed" }) ? "failed" : "ok"
end