Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Upcoming Open-TYNDP Release

**Bugfixes and Compatibility**

* Ensure ``inflow_t`` is always defined in ``attach_hydro``, resolving a pylint use-before-assignment issue (https://github.com/open-energy-transition/open-tyndp/pull/777).
Comment thread
daniel-rdt marked this conversation as resolved.
Outdated

**Documentation**

* Update benchmarking documentation tables and figures for v0.7.1 (https://github.com/open-energy-transition/open-tyndp/pull/711).
Expand Down
3 changes: 2 additions & 1 deletion scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ def attach_hydro(
country = ppl["bus"].map(n.buses.country).rename("country")

inflow_idx = ror.index.union(hydro.index)
inflow_t = pd.DataFrame()
if not inflow_idx.empty:
dist_key = ppl.loc[inflow_idx, "p_nom"].groupby(country).transform(normed)

Expand Down Expand Up @@ -853,7 +854,7 @@ def attach_hydro(
capital_cost=costs.at["ror", "capital_cost"],
weight=ror["p_nom"],
p_max_pu=(
inflow_t[ror.index] # pylint: disable=E0606
inflow_t[ror.index]
.divide(ror["p_nom"], axis=1)
.where(lambda df: df <= 1.0, other=1.0)
),
Expand Down