mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 05:37:14 +00:00
add TOTALS to databaeReset timings
This commit is contained in:
@@ -224,9 +224,10 @@ class JobQueue:
|
||||
"logbooks",
|
||||
"QMs",
|
||||
"scans",
|
||||
"survex",
|
||||
"drawings",
|
||||
"survex",
|
||||
"test",
|
||||
"TOTAL"
|
||||
]
|
||||
for k in self.results_order:
|
||||
self.results[k] = []
|
||||
@@ -246,10 +247,23 @@ class JobQueue:
|
||||
data = json.load(f)
|
||||
for j in data:
|
||||
self.results[j] = data[j]
|
||||
# print(data[j])
|
||||
except:
|
||||
print(f"FAILURE parsing JSON file {self.tfile}")
|
||||
# Python bug: https://github.com/ShinNoNoir/twitterwebsearch/issues/12
|
||||
f.close()
|
||||
self.results["TOTAL"] = []
|
||||
for i in range(len(self.results["date"])):
|
||||
total = 0
|
||||
for module in self.results_order:
|
||||
if module in ["runlabel", "date", "test", "TOTAL"]:
|
||||
continue
|
||||
# print(i, module, f"length={len(self.results[module])} ")
|
||||
if self.results[module][i]:
|
||||
total += float(self.results[module][i])
|
||||
self.results["TOTAL"].append(total)
|
||||
|
||||
|
||||
for j in self.results_order:
|
||||
self.results[j].append(None) # append a placeholder
|
||||
return True
|
||||
@@ -307,7 +321,7 @@ class JobQueue:
|
||||
return True
|
||||
|
||||
def append_placeholders(self):
|
||||
"""Ads a dummy timing for each option, to fix off by one error"""
|
||||
"""Adds a dummy timing for each option, to fix off by one error"""
|
||||
for j in self.results_order:
|
||||
self.results[j].append(None) # append a placeholder
|
||||
|
||||
@@ -373,6 +387,11 @@ class JobQueue:
|
||||
else:
|
||||
print(" - ", end=" ")
|
||||
print("")
|
||||
print("\n TOTAL (s)", end=" ")
|
||||
for t in self.results["TOTAL"]:
|
||||
if t:
|
||||
print(f"{t:8.1f}", end=" ")
|
||||
#print(f"{t}", end=" ")
|
||||
print("\n")
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user