Skip to content

Commit

Permalink
record analyze_status for calibration experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
Xia Hong committed Jan 8, 2020
1 parent 2ce7ffa commit 00ef996
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/app/controllers/experiments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1479,12 +1479,14 @@ def background_analyze_data(experiment)
raise "**#{experiment.experiment_definition.guid}** not implemented"
end

logger.info("code=#{response.code} response=#{response}")

if response.code != 200
raise_julia_error(response)
else
new_data = CachedAnalyzeDatum.new(:experiment_id=>experiment.id, :analyze_result=>response.body)
#update analyze status
if experiment.diagnostic?
if experiment.diagnostic? || experiment.calibration?
analysis_results = JSON.parse(response.body)
experiment.update_attributes(:analyze_status=>(analysis_results["valid"] != true)? "failed" : "success")
end
Expand Down
4 changes: 4 additions & 0 deletions web/app/models/experiment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ def running?
def diagnostic?
experiment_definition.experiment_type == ExperimentDefinition::TYPE_DIAGNOSTIC
end

def calibration?
experiment_definition.experiment_type == ExperimentDefinition::TYPE_CALIBRATION
end

def diagnostic_passed?
diagnostic? && completion_status == "success" && analyze_status == "success"
Expand Down

0 comments on commit 00ef996

Please sign in to comment.