Skip to content

Commit

Permalink
Merge branch 'master' of fias.uni-frankfurt.de:scm/pypsa
Browse files Browse the repository at this point in the history
  • Loading branch information
nworbmot committed Nov 30, 2017
2 parents 8a2ff7c + 3e4e846 commit 2b02eea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pypsa/opf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ def network_lopf_solve(network, snapshots=None, formulation="angles", solver_opt
else:
network.results = network.opt.solve(*args, suffixes=["dual"], keepfiles=keep_files, options=solver_options)

if logger.level > 0:
if logger.isEnabledFor(logging.INFO):
network.results.write()

status = network.results["Solver"][0]["Status"].key
Expand Down
4 changes: 2 additions & 2 deletions pypsa/pf.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def aggregate_multi_graph(sub_network):
attr_mean = ["capital_cost","length","terrain_factor"]

for attr in attr_inv:
aggregated[attr] = 1/(1/lines[attr]).sum()
aggregated[attr] = 1./(1./lines[attr]).sum()

for attr in attr_sum:
aggregated[attr] = lines[attr].sum()
Expand Down Expand Up @@ -985,7 +985,7 @@ def sub_network_lpf(sub_network, snapshots=None, skip_pre=False):
network.buses_t.v_mag_pu.loc[snapshots, buses_o] = 1.

# set slack bus power to pick up remained
slack_adjustment = (- network.buses_t.p.loc[snapshots, buses_o[1:]].sum(axis=1)
slack_adjustment = (- network.buses_t.p.loc[snapshots, buses_o[1:]].sum(axis=1).fillna(0.)
- network.buses_t.p.loc[snapshots, buses_o[0]])
network.buses_t.p.loc[snapshots, buses_o[0]] += slack_adjustment

Expand Down

0 comments on commit 2b02eea

Please sign in to comment.