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

s_max_pu = 1 for some lines despite default config of 0.7 #1276

Closed
grecht opened this issue Sep 11, 2024 · 4 comments · Fixed by #1323
Closed

s_max_pu = 1 for some lines despite default config of 0.7 #1276

grecht opened this issue Sep 11, 2024 · 4 comments · Fixed by #1323
Assignees
Labels

Comments

@grecht
Copy link

grecht commented Sep 11, 2024

Hi everyone! I noticed that some lines have s_max_pu values of 1 instead of 0.7. These are mostly TYNDP2020 lines and some lines whose names start with "P", see the output below.
If this is intentional, what is the reasoning behind this? I could not find anything in the documentation, and the default config file which I used specifies s_max_pu: 0.7 which should hold for all lines, as I understand it.

What I did

  • built the "default" PyPSA-Eur (on commit b328169) in different spatial resolutions using
    snakemake resources/networks/elec_s_{39,128,256,512,1024}.nc -call --configfile config/config.default.yaml
  • executed this
import pypsa

nw_path = "resources/networks/elec_s.nc"
nw = pypsa.Network(nw_path)
print(nw.lines.loc[nw.lines["s_max_pu"] == 1].index)

The output:

WARNING:pypsa.io:Importing network from PyPSA version v0.30.1 while current version is v0.30.2. Read the release notes at https://pypsa.readthedocs.io/en/latest/release_notes.html to prepare your network for import.
INFO:pypsa.io:Imported network elec_s.nc has buses, carriers, generators, lines, links, loads, shapes, storage_units
Index(['TYNDP2020_0', 'TYNDP2020_1', 'TYNDP2020_2', 'TYNDP2020_3',
       'TYNDP2020_4', 'TYNDP2020_6', 'TYNDP2020_8', 'TYNDP2020_9',
       'TYNDP2020_11', 'TYNDP2020_13', 'TYNDP2020_14', 'TYNDP2020_15',        
       'TYNDP2020_16', 'TYNDP2020_17', 'TYNDP2020_24', 'TYNDP2020_25',        
       'TYNDP2020_26', 'TYNDP2020_27', 'TYNDP2020_28', 'TYNDP2020_29',        
       'TYNDP2020_30', 'TYNDP2020_31', 'TYNDP2020_32', 'TYNDP2020_33',        
       'TYNDP2020_34', 'TYNDP2020_35', 'TYNDP2020_36', 'TYNDP2020_37',        
       'TYNDP2020_47', 'TYNDP2020_48', 'TYNDP2020_49', 'TYNDP2020_50',        
       'TYNDP2020_51', 'TYNDP2020_53', 'TYNDP2020_54', 'TYNDP2020_56',        
       'TYNDP2020_57', 'TYNDP2020_59', 'TYNDP2020_60', 'TYNDP2020_74',        
       'TYNDP2020_77', 'TYNDP2020_82', 'TYNDP2020_88', 'TYNDP2020_89',        
       'TYNDP2020_90', 'TYNDP2020_92', 'TYNDP2020_94', 'TYNDP2020_97',        
       'TYNDP2020_98', 'TYNDP2020_99', 'TYNDP2020_100', 'TYNDP2020_101',      
       'TYNDP2020_113', 'TYNDP2020_120', 'TYNDP2020_121', 'TYNDP2020_122',    
       'TYNDP2020_123', 'TYNDP2020_124', 'TYNDP2020_125', 'TYNDP2020_132',    
       'TYNDP2020_133', 'TYNDP2020_134', 'TYNDP2020_135', 'P43', 'P71', 'P84',
       'P227', 'P402', 'P470', 'P476', 'P478', 'P485', 'P490', 'P540', 'P625',
       'P627', 'P635', 'P636'],
      dtype='object', name='Line')
@grecht grecht added the bug label Sep 11, 2024
@fneum
Copy link
Member

fneum commented Sep 11, 2024

No, it's not intended and should indeed be 0.7 also for TYNDP links.

@grecht
Copy link
Author

grecht commented Sep 13, 2024

A quick fix would be adding the following line to the main body of build_transmission_projects.py, which worked for me (see 4ee4884)

new_lines_df["s_max_pu"] = snakemake.config["lines"]["s_max_pu"]

But it really makes no sense to put this there instead of a single place where s_max_pu is set for all lines. I think this should probably happen here:

set_line_s_max_pu(n, snakemake.params.lines["s_max_pu"])

But apparently, this is not applied to the transmission projects, not sure why. Maybe it is due to the order of execution.

@p-glaum
Copy link
Contributor

p-glaum commented Sep 24, 2024

Hi @grecht , you are right! I thought the line factor would be applied later for all lines but it already happens in base_network. I added your suggestion in PR #1323

Thanks for reporting the bug!

@grecht
Copy link
Author

grecht commented Sep 26, 2024

Sure, thanks for fixing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants