Skip to content

Commit

Permalink
Merge pull request #798 from tgi-climact/fix/distributed-generators
Browse files Browse the repository at this point in the history
Fix nodal fraction with distributed generators
  • Loading branch information
fneum authored Dec 11, 2023
2 parents 8d509f4 + e3ba0e5 commit 4ed59eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Upcoming Release
**Bugs and Compatibility**

* A bug preventing custom powerplants specified in ``data/custom_powerplants.csv`` was fixed. (https://github.com/PyPSA/pypsa-eur/pull/732)
* Fix nodal fraction in ``add_existing_year`` when using distributed generators


PyPSA-Eur 0.8.1 (27th July 2023)
Expand Down
4 changes: 3 additions & 1 deletion scripts/add_existing_baseyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def add_existing_renewables(df_agg):
]
cfs = n.generators_t.p_max_pu[gens].mean()
cfs_key = cfs / cfs.sum()
nodal_fraction.loc[n.generators.loc[gens, "bus"]] = cfs_key.values
nodal_fraction.loc[n.generators.loc[gens, "bus"]] = cfs_key.groupby(
n.generators.loc[gens, "bus"]
).sum()

nodal_df = df.loc[n.buses.loc[elec_buses, "country"]]
nodal_df.index = elec_buses
Expand Down

0 comments on commit 4ed59eb

Please sign in to comment.