diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index 1f43852553d75bcb51c14d9eb15ceb81f10c132f..e9bf47ebf2c2f7622b19de7c7868775bddc993cb 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -709,11 +709,17 @@ def construct_summary(task): # find the plots in the quality json structure summary = task.quality_json["summary"] - #loaded = json.loads(summary) + + total_size_input = 0 + total_size_output = 0 + for key in summary: record = summary[key] - line = '' + total_size_input += record['input_size'] + total_size_output+= record['output_size'] + + line = '' line += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>' + key + '</b></td></tr>' line += '<th></th><th>Name</th><th>Size</th>' @@ -775,4 +781,13 @@ def construct_summary(task): results += line + try: + results += '<th>Totals</th>' + results += '<tr><td colspan="1"><b>Input size</b></td><td>' + str(total_size_input) + '</td></tr>' + results += '<tr><td colspan="1"><b>Outtput size</b><td>' + str(total_size_output) + '</td></tr>' + results += '<tr><td colspan="1"><b>Ratioatio</b></td><td>' + str(total_size_output/total_size_output) + '</td></tr>' + + except: + pass + return results