Skip to content

Commit

Permalink
fix to avoid negative objective value (#961)
Browse files Browse the repository at this point in the history
* fix to avoid negative objective value

* revert change

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added rebase voltage for buses

* added release note

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
GbotemiB and pre-commit-ci[bot] authored Jul 12, 2024
1 parent e3aefd4 commit af64048
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t

* Create files where the code outputs the value of the objective function. `PR #1033 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1033>`__

* Minor bug-fixing for s_nom_min. `PR #961 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/961>`__

PyPSA-Earth 0.3.0
=================

Expand Down
5 changes: 4 additions & 1 deletion scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ def simplify_network_to_base_voltage(n, linetype, base_voltage):
are moved from their starting bus to their ending bus. The
corresponding starting buses are removed as well.
"""
logger.info(f"Mapping all network lines onto a single {int(base_voltage)}kV layer")

logger.info(f"Mapping all network lines onto a single {int(base_voltage)}kV layer")
n.buses["v_nom"] = base_voltage
n.lines["type"] = linetype
n.lines["v_nom"] = base_voltage
n.lines["i_nom"] = n.line_types.i_nom[linetype]
Expand Down Expand Up @@ -1100,6 +1101,7 @@ def merge_isolated_nodes(n, threshold, aggregation_strategies=dict()):
"substation_lv",
"substation_off",
}.intersection(n.buses.columns)

n.buses = n.buses.drop(buses_c, axis=1)

update_p_nom_max(n)
Expand All @@ -1111,6 +1113,7 @@ def merge_isolated_nodes(n, threshold, aggregation_strategies=dict()):
s_threshold_fetch_isolated = cluster_config.get("s_threshold_fetch_isolated", False)

n = drop_isolated_nodes(n, threshold=p_threshold_drop_isolated)

if p_threshold_merge_isolated:
n, merged_nodes_map = merge_isolated_nodes(
n,
Expand Down

0 comments on commit af64048

Please sign in to comment.