From 1f7dbd80b3c48081049e1102daf687c2f6ca4563 Mon Sep 17 00:00:00 2001 From: Jose Gracia Date: Tue, 13 Feb 2024 14:34:08 +0100 Subject: [PATCH] Refactor variable name --- monitoring/db/scripts/get_detailed_power.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index 27c06e0..7f01db8 100755 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -49,19 +49,19 @@ class Power: idx_ts = 0; idx_node = 1; idx_value = 2 nodes = list(OrderedDict.fromkeys([line[idx_node] for line in data])) # preserves order of nodes - cls = Power(nodes) + power = Power(nodes) values = {} for l in data: ts = l[idx_ts] if ts not in values: values[ts] = [] - power = l[idx_value] - values[ts].append(power) + value = l[idx_value] + values[ts].append(value) epochs = values.keys() for epoch in epochs: - cls.insert_epoch(epoch, values[epoch]) + power.insert_epoch(epoch, values[epoch]) # check implicit assumptions: 1) ts/epochs are sorted e = list(epochs) @@ -77,7 +77,7 @@ class Power: print("Warning: Unexpected number of nodes ({actual}/{expected})".format(actual=actual, expected=nnodes)) break - return cls + return power @classmethod def from_db(cls, db, jobid, interval, hawk_ai):