Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Myopic code adds renewable capacity twice #789

Closed
2 tasks done
Irieo opened this issue Dec 1, 2023 · 1 comment
Closed
2 tasks done

Myopic code adds renewable capacity twice #789

Irieo opened this issue Dec 1, 2023 · 1 comment
Labels
Milestone

Comments

@Irieo
Copy link
Contributor

Irieo commented Dec 1, 2023

Checklist

  • I am using the current master branch or the latest release. Please indicate.
  • I am running on an up-to-date pypsa-eur environment. Update via conda env update -f envs/environment.yaml.

Describe the Bug

add_existing_baseyear.py of the myopic code branch adds capacity for ["solar", "onwind", "offwind"] carriers twice.

to reproduce: call add_existing_baseyear rule output file, e.g.:
snakemake -call results/myopic-master/prenetworks-brownfield/elec_s_2_lv1.0__3H-B_2025.nc

and revise dataframe: n.generators[(n.generators.index.str.contains('DE')) & (n.generators.carrier=='solar')]
image

Possible quick fix:

these lines placed at the end of the script fix the carrier capacities:

  for generator in ["solar", "onwind", "offwind"]:
      mask = n.generators.index.str.contains(f"{generator}-{baseyear}")
      if len(mask) > 0: 
          n.generators.loc[mask, "p_nom"] = 0.0
          n.generators.loc[mask, "p_nom_min"] = 0.0

For a proper fix:

for a proper fix, the script add_existing_baseyear.py should be thoroughly revised. Potential problems:

  • in general, the idea that we strip the renewable capacity to add them again (thus replicating the code of the add_electricity.py)
  • in general, the idea to have "carrier" and "year" information in generator name (not a standard for pypsa code)
  • hard-coded values and assumptions (e.g., "1999" -> why do we remove RES before 1999? why hard-coded?)
  • complex nested loops and if-conditions
  • "# this is for the year 2020" ??
@Irieo Irieo added the bug label Dec 1, 2023
@fneum fneum added this to the v0.11.0 milestone May 12, 2024
@fneum
Copy link
Member

fneum commented May 23, 2024

same as #1016

closing this one as "duplicate"

@fneum fneum closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants