From 7621456c5fda25e713e5454d4c3bbeae30211347 Mon Sep 17 00:00:00 2001 From: Richard Lincoln Date: Sun, 3 May 2020 07:38:15 +0200 Subject: [PATCH] Fixes #57 --- pypower/runpf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypower/runpf.py b/pypower/runpf.py index 62a54c2..74a0d76 100644 --- a/pypower/runpf.py +++ b/pypower/runpf.py @@ -242,7 +242,7 @@ def runpf(casedata=None, ppopt=None, fname='', solvedcase=''): gen[mx, QG] = fixedQg[mx] ## set Qg to binding for i in range(len(mx)): ## [one at a time, since they may be at same bus] gen[mx[i], GEN_STATUS] = 0 ## temporarily turn off gen, - bi = gen[mx[i], GEN_BUS] ## adjust load accordingly, + bi = gen[mx[i], GEN_BUS].astype(int) ## adjust load accordingly, bus[bi, [PD, QD]] = (bus[bi, [PD, QD]] - gen[mx[i], [PG, QG]]) if len(ref) > 1 and any(bus[gen[mx, GEN_BUS], BUS_TYPE] == REF):