pypsa-usa
pypsa-usa copied to clipboard
Add nuclear repeatedly in add_extra_components.py
Checklist
- [x] I am using the current
masterbranch - [x] I am running on an up-to-date
pypsa-usaenvironment. Update viaconda env update -f envs/environment.yaml
The Issue
New nuclear is added to the network twice. The 1st time spilts xx nuclear in to xx nuclear and xx nuclear existing:
if snakemake.params.retirement == "economic":
economic_retirement_gens = set(elec_config.get("conventional_carriers", None))
split_retirement_gens(
n,
costs_dict[n.investment_periods[0]],
economic_retirement_gens,
economic=True,
)
The 2nd time adds xx nuclear_year:
new_carriers = list(
set(elec_config["extendable_carriers"].get("Generator", [])) - set(n.generators.carrier.unique())
| set(["nuclear"] if "nuclear" in elec_config["extendable_carriers"].get("Generator", []) else []),
)
for investment_year in n.investment_periods:
costs = costs_dict[investment_year]
attach_storageunits(n, costs, elec_config, investment_year)
attach_multihorizon_existing_generators(n, costs, multi_horizon_gens, investment_year)
attach_multihorizon_egs(n, costs, costs_dict, egs_gens, investment_year)
attach_multihorizon_new_generators(n, costs, new_carriers, investment_year)
attach_stores(n, costs, elec_config, investment_year)
Steps To Reproduce
Run default config with planning_horizons: [2050]
Expected Behavior
No response
Error Message
Anything else?
No response