pypsa-usa icon indicating copy to clipboard operation
pypsa-usa copied to clipboard

Add nuclear repeatedly in add_extra_components.py

Open WeiAi-Energy opened this issue 5 months ago • 0 comments

Checklist

  • [x] I am using the current master branch
  • [x] I am running on an up-to-date pypsa-usa environment. Update via conda 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)

Image

Steps To Reproduce

Run default config with planning_horizons: [2050]

Expected Behavior

No response

Error Message


Anything else?

No response

WeiAi-Energy avatar Jul 03 '25 00:07 WeiAi-Energy