Merge pull request #798 from tgi-climact/fix/distributed-generators
Fix nodal fraction with distributed generators
This commit is contained in:
commit
4ed59eb4b4
@ -39,6 +39,7 @@ Upcoming Release
|
|||||||
**Bugs and Compatibility**
|
**Bugs and Compatibility**
|
||||||
|
|
||||||
* A bug preventing custom powerplants specified in ``data/custom_powerplants.csv`` was fixed. (https://github.com/PyPSA/pypsa-eur/pull/732)
|
* 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)
|
PyPSA-Eur 0.8.1 (27th July 2023)
|
||||||
|
@ -88,7 +88,9 @@ def add_existing_renewables(df_agg):
|
|||||||
]
|
]
|
||||||
cfs = n.generators_t.p_max_pu[gens].mean()
|
cfs = n.generators_t.p_max_pu[gens].mean()
|
||||||
cfs_key = cfs / cfs.sum()
|
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 = df.loc[n.buses.loc[elec_buses, "country"]]
|
||||||
nodal_df.index = elec_buses
|
nodal_df.index = elec_buses
|
||||||
|
Loading…
Reference in New Issue
Block a user