Skip to content

Commit

Permalink
py26 and py33 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lthurner committed Feb 16, 2017
1 parent 448c414 commit eb79b60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: python
python:
# We don't actually use the Travis Python, but this keeps it organized.
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"

Expand Down
8 changes: 6 additions & 2 deletions pandapower/build_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def _trafo_df_from_trafo3w(net):
sn = np.array([ttab.sn_hv_kva, ttab.sn_mv_kva, ttab.sn_lv_kva])
uk_2w = z_br_to_bus(uk, sn)
ur_2w = z_br_to_bus(ur, sn)
taps = [{tv: np.nan for tv in tap_variables} for _ in range(3)]
taps = [dict((tv, np.nan) for tv in tap_variables) for _ in range(3)]
for k in range(3):
taps[k]["tp_side"] = None

Expand Down Expand Up @@ -399,7 +399,11 @@ def _trafo_df_from_trafo3w(net):
trafo_df = pd.DataFrame(trafos2w).T
for var in list(tap_variables) + ["i0_percent", "sn_kva", "vsc_percent", "vscr_percent",
"vn_hv_kv", "vn_lv_kv", "pfe_kw"]:
trafo_df[var] = pd.to_numeric(trafo_df[var])
try:
trafo_df[var] = pd.to_numeric(trafo_df[var])
except:
#legacy support for pandas versions < 0.17
trafo_df[var] = trafo_df[var].convert_objects(convert_numeric=True)
return trafo_df


Expand Down

0 comments on commit eb79b60

Please sign in to comment.