Skip to content

Commit

Permalink
Bugfix: ref must be a numpy array.
Browse files Browse the repository at this point in the history
  • Loading branch information
friederikemeier committed Nov 22, 2016
1 parent 7b10c41 commit 7a9b687
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pypower/bustypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

from numpy import ones, flatnonzero as find
from numpy import zeros
from scipy.sparse import csr_matrix as sparse

from pypower.idx_bus import BUS_TYPE, REF, PV, PQ
Expand Down Expand Up @@ -42,6 +43,7 @@ def bustypes(bus, gen):
# pick a new reference bus if for some reason there is none (may have been
# shut down)
if len(ref) == 0:
ref = zeros(1, dtype=int)
ref = pv[0] # use the first PV bus
pv = pv[1:] # take it off PV list

Expand Down

0 comments on commit 7a9b687

Please sign in to comment.