Skip to content

Commit

Permalink
Merge pull request #47 from Heiner92/SmallFixes
Browse files Browse the repository at this point in the history
Added small fixes for issues #41 and #19
  • Loading branch information
rwl authored Dec 3, 2017
2 parents 9cde3d8 + 601f44f commit 2b99f9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pypower/ext2int.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def ext2int(ppc, val_or_field=None, ordering=None, dim=0):

## save data matrices with external ordering
if 'ext' not in o: o['ext'] = {}
o["ext"]["bus"] = ppc["bus"].copy()
o["ext"]["branch"] = ppc["branch"].copy()
o["ext"]["gen"] = ppc["gen"].copy()
o["ext"]["bus"] = ppc["bus"].copy().astype(int)
o["ext"]["branch"] = ppc["branch"].copy().astype(int)
o["ext"]["gen"] = ppc["gen"].copy().astype(int)
if 'areas' in ppc:
if len(ppc["areas"]) == 0: ## if areas field is empty
del ppc['areas'] ## delete it (so it's ignored)
Expand Down
2 changes: 1 addition & 1 deletion pypower/printpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def printpf(baseMVA, bus=None, gen=None, branch=None, f=None, success=None,
tap = ones(nl) ## default tap ratio = 1 for lines
xfmr = find(branch[:, TAP]) ## indices of transformers
tap[xfmr] = branch[xfmr, TAP] ## include transformer tap ratios
tap = tap * exp(1j * pi / 180 * branch[:, SHIFT]) ## add phase shifters
tap = tap * exp(-1j * pi / 180 * branch[:, SHIFT]) ## add phase shifters
nzld = find((bus[:, PD] != 0.0) | (bus[:, QD] != 0.0))
sorted_areas = sort(bus[:, BUS_AREA])
## area numbers
Expand Down

0 comments on commit 2b99f9f

Please sign in to comment.