compatibility with python3.9, small fixes
This commit is contained in:
+12
-9
@@ -239,7 +239,7 @@ HISTO_COLUMNS = {
|
||||
"Mem_Eff",
|
||||
"Planned_Time",
|
||||
"Time_Eff",
|
||||
"UsesMem",
|
||||
"UsedMem",
|
||||
"Walltime",
|
||||
}
|
||||
|
||||
@@ -1025,7 +1025,7 @@ def make_single_row(rec: JobRecord, dflt_mpcpu: float,
|
||||
vectors[colname] = []
|
||||
if colname == "walltime":
|
||||
vectors[colname] = [rec.elapsed_sec/3600]
|
||||
elif colname == "used_mem" and rec.mem_used_tres is not None:
|
||||
elif colname == "usedmem" and rec.mem_used_tres is not None:
|
||||
vectors[colname] = [rec.mem_used_tres]
|
||||
elif colname == "elig_qtime":
|
||||
vectors[colname] = [rec.elig_qtime_sec/3600]
|
||||
@@ -1134,7 +1134,7 @@ def make_aggregate_row(records: list[JobRecord], username: str, partition: str,
|
||||
if colname == "walltime":
|
||||
vectors[colname] = [r.elapsed_sec/3600 for r in records
|
||||
if r.elapsed_sec is not None]
|
||||
elif colname == "used_mem":
|
||||
elif colname == "usedmem":
|
||||
vectors[colname] = [r.mem_used_tres for r in records
|
||||
if r.mem_used_tres is not None]
|
||||
elif colname == "elig_qtime":
|
||||
@@ -1283,10 +1283,9 @@ def columns_from_fmtstr(fmt: str) -> list[str]:
|
||||
from bisect import bisect_right
|
||||
from collections.abc import Iterable, Sequence
|
||||
from math import ceil, exp, floor, log, log10
|
||||
from typing import TypeAlias
|
||||
|
||||
|
||||
Metricnumber: TypeAlias = int | float
|
||||
Metricnumber = Union[int, float]
|
||||
|
||||
|
||||
def percentile(sorted_values: Sequence[float], p: float) -> float:
|
||||
@@ -1490,10 +1489,14 @@ plot_cmd = 'plot "{tmpfile.name}" \\
|
||||
|
||||
gnuplot_cmd += "'\neval plot_cmd\n"
|
||||
# print(f"DEBUG: GNUPLOT_SCRIPT:\n{gnuplot_cmd}")
|
||||
run(["gnuplot"],
|
||||
input=gnuplot_cmd,
|
||||
text=True,
|
||||
check=True,)
|
||||
try:
|
||||
run(["gnuplot"],
|
||||
input=gnuplot_cmd,
|
||||
text=True,
|
||||
check=True,)
|
||||
except FileNotFoundError:
|
||||
sys.stderr.write("ERROR: Cannot execute gnuplot for histogram creation. Is it installed?\n")
|
||||
sys.exit(1)
|
||||
os.remove(tmpfile.name)
|
||||
|
||||
# HISTOGRAMMING CODE END
|
||||
|
||||
Reference in New Issue
Block a user