From 4853446fa0ffdcc91557024505f2e1f25e93ffe2 Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Tue, 12 Mar 2024 18:12:36 +0100 Subject: [PATCH] fixed code incompatible with python3 in powerdiagram --- cocluto/PowerDiagram.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocluto/PowerDiagram.py b/cocluto/PowerDiagram.py index 6999e40..8dfcabb 100644 --- a/cocluto/PowerDiagram.py +++ b/cocluto/PowerDiagram.py @@ -52,7 +52,7 @@ class Machine(object): def get_max_amperes(self): capacity = None if len(self.input_plugs) > 0: - capacity = self.input_plugs.values()[0].get_max_amperes() + capacity = list(self.input_plugs.values())[0].get_max_amperes() capacity = add_capacity_constraints(capacity, self.current_capacity_constraint) return capacity @@ -189,7 +189,7 @@ class Connection(object): from_machine = self.from_plug.machine if from_machine.is_power_provider(): return from_machine - input_plug_names = from_machine.input_plugs.keys() + input_plug_names = list(from_machine.input_plugs.keys()) assert len(input_plug_names) == 1, "from_machine is supposed to be a power strip (which is expected to only have one input)" input_plug = from_machine.input_plugs[input_plug_names[0]] return input_plug.get_incoming_connection().get_power_provider()