PyPSA / PyPSA/pypsa-usa

Add nuclear repeatedly in add_extra_components.py

Open
#632 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
148
Forks
55
Avg merge
2d 11h
Merged PRs (30d)
18

Description

Checklist
  • I am using the current master branch
  • 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in add_extra_components.py and reproduce the issue with the default configuration and planning_horizons: [2050]. Trace the retirement split and new-generator attachment paths shown in the report; done means new nuclear is not added twice or represented by duplicate nuclear variants.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.