Skip to content
Snippets Groups Projects

small bugfix

Merged Nico Vermaas requested to merge SDC-779-add-summary-info into master
3 files
+ 75
72
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -708,85 +708,90 @@ def construct_summary(task):
results = ""
# find the plots in the quality json structure
summary = task.quality_json["summary"]
total_size_input = 0
total_size_output = 0
for key in summary:
record = summary[key]
try:
summary = task.quality_json["summary"]
results = "<h4>Summary File (for sas_id " + task.sas_id+ ")</h4> "
#<h4><img src="{% static 'taskdatabase/ldvlogo_small.png' %}" height="30" alt="summary">
# Summary File (sas_id {{ task.sas_id }}) </h4>
total_size_input = 0
total_size_output = 0
for key in summary:
record = summary[key]
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>'
line += '<tr><td><b>Input</b></td>'
line += '<td>' + record['input_name'] + '</td>'
line += '<td>' + str(record['input_size']) + ' (' + record['input_size_str'] + ')</td>'
line += '</tr>'
line += '<tr><td><b>Output</b></td>'
line += '<td>' + record['output_name'] + '</td>'
line += '<td>' + str(record['output_size']) + ' (' + record['output_size_str'] + ')</td>'
line += '</tr>'
line += '<tr><td><b>Ratio</b></td>'
line += '<td>' + str(round(record['size_ratio'],3)) + '</td>'
line += '</tr>'
total_size_input += record['input_size']
total_size_output+= record['output_size']
try:
input_content = record['input_content']
if input_content:
line += '<th>Input Content</th>'
line += '<tr><td colspan="3">'
for filename in input_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
line = ''
line += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>' + key + '</b></td></tr>'
try:
output_content = record['output_content']
if output_content:
line += '<th>Output Content</th>'
line += '<tr><td colspan="3">'
for filename in output_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
line += '<th></th><th>Name</th><th>Size</th>'
line += '<tr><td><b>Input</b></td>'
line += '<td>' + record['input_name'] + '</td>'
line += '<td>' + str(record['input_size']) + ' (' + record['input_size_str'] + ')</td>'
line += '</tr>'
line += '<tr><td><b>Output</b></td>'
line += '<td>' + record['output_name'] + '</td>'
line += '<td>' + str(record['output_size']) + ' (' + record['output_size_str'] + ')</td>'
line += '</tr>'
line += '<tr><td><b>Ratio</b></td>'
line += '<td>' + str(round(record['size_ratio'],3)) + '</td>'
line += '</tr>'
try:
to_add = record['to_add']
if to_add:
line += '<th>to_add</th>'
line += '<tr><td colspan="3">'
for filename in to_add:
line += filename + '\n'
line += '</td></tr>'
except:
pass
try:
input_content = record['input_content']
if input_content:
line += '<th>Input Content</th>'
line += '<tr><td colspan="3">'
for filename in input_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
try:
to_delete = record['to_delete']
if to_delete:
line += '<th>to_delete</th>'
line += '<tr><td colspan="3">'
for filename in to_delete:
line += filename + '\n'
line += '</td></tr>'
except:
pass
try:
output_content = record['output_content']
if output_content:
line += '<th>Output Content</th>'
line += '<tr><td colspan="3">'
for filename in output_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
results += line
try:
to_add = record['to_add']
if to_add:
line += '<th>to_add</th>'
line += '<tr><td colspan="3">'
for filename in to_add:
line += filename + '\n'
line += '</td></tr>'
except:
pass
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>Output size</b><td>' + str(total_size_output) + '</td></tr>'
results += '<tr><td colspan="1"><b>Ratio</b></td><td>' + str(total_size_output/total_size_output) + '</td></tr>'
try:
to_delete = record['to_delete']
if to_delete:
line += '<th>to_delete</th>'
line += '<tr><td colspan="3">'
for filename in to_delete:
line += filename + '\n'
line += '</td></tr>'
except:
pass
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>Output size</b><td>' + str(total_size_output) + '</td></tr>'
results += '<tr><td colspan="1"><b>Ratio</b></td><td>' + str(total_size_output/total_size_output) + '</td></tr>'
except:
pass
Loading