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

Fix hydropower and load bugs #1054

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ Upcoming Release

* Bugfix: allow modelling sector-coupled landlocked regions. (Fixed handling of offshore wind.)

* Bugfix: approximation of hydro power generation if Portugal or Spain are not included works now.

* Bugfix: copy_timeslice does not copy anymore, if country not present in load data.

* Adapt the disabling of transmission expansion in myopic foresight optimisations when limit is already reached to also handle cost limits.

* Fix duplicated years and grouping years reference in `add_land_use_constraint_m`.
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_electricity_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def copy_timeslice(load, cntry, start, stop, delta, fn_load=None):
load.loc[start:stop, cntry] = load.loc[
start - delta : stop - delta, cntry
].values
elif fn_load is not None:
elif fn_load is not None and cntry in load:
duration = pd.date_range(freq="h", start=start - delta, end=stop - delta)
load_raw = load_timeseries(fn_load, duration, [cntry])
load.loc[start:stop, cntry] = load_raw.loc[
Expand Down
5 changes: 4 additions & 1 deletion scripts/build_hydro_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def approximate_missing_eia_stats(eia_stats, runoff_fn, countries):
runoff.index = runoff.index.astype(int)

# fix outliers; exceptional floods in 1977-1979 in ES & PT
runoff.loc[1978, ["ES", "PT"]] = runoff.loc[1979, ["ES", "PT"]]
if "ES" in runoff:
runoff.loc[1978, ["ES"]] = runoff.loc[1979, ["ES"]]
if "PT" in runoff:
runoff.loc[1978, ["PT"]] = runoff.loc[1979, ["PT"]]
fneum marked this conversation as resolved.
Show resolved Hide resolved

runoff_eia = runoff.loc[eia_stats.index]

Expand Down
Loading