From ad972fffd2c91c6cc7499eb407e8e27f384d10f7 Mon Sep 17 00:00:00 2001 From: vermaas <vermaas@astron.nl> Date: Thu, 8 Dec 2022 11:39:24 +0100 Subject: [PATCH] new layout without input_content and output_content --- atdb/taskdatabase/services/algorithms.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index 1f438525..e9bf47eb 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 -- GitLab