Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise export ports data #1175

Merged
merged 15 commits into from
Nov 28, 2024
Merged
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ rule add_export:
costs=config["costs"],
input:
overrides="data/override_component_attrs",
export_ports="data/export_ports.csv",
export_ports="data/ports.csv",
costs=COSTDIR + "costs_{planning_horizons}.csv",
ship_profile="resources/ship_profile_{h2export}TWh.csv",
network=RESDIR
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ E.g. if a new rule becomes available describe how to use it `make test` and in o

* Fix bugs in `prepare_sector_network.py` related to links with H2 buses and bug of re-addition of H2 and battery carriers in present `PR #1145 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1145>`_

* Revise ports data for export in `add_export.py` related to sector model `PR #1175 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1175>`_

PyPSA-Earth 0.4.1
=================

Expand Down
5 changes: 4 additions & 1 deletion scripts/add_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ def select_ports(n):
This function selects the buses where ports are located.
"""

ports = pd.read_csv(
raw_ports = pd.read_csv(
snakemake.input.export_ports,
index_col=None,
keep_default_na=False,
).squeeze()

ports = raw_ports[["name", "country", "fraction", "x", "y"]]
ports.loc[:, "fraction"] = ports.fraction.round(1)

ports = ports[ports.country.isin(countries)]
if len(ports) < 1:
logger.error(
Expand Down
Loading