Pypsa-eur: build_shapes rule error, modelling for Austria

269 views
Skip to first unread message

Amir ElShennawi

unread,
Aug 2, 2021, 6:42:39 PM8/2/21
to pypsa
Dear Team,

I am running PyPSA-Eur to model some scenarios for Austria. I am doing initially top-level configuration. I only changed country to AT and the solver to cbc as seen in my config.yaml file and I run solve_all_networks.

I am getting an error in the build_shapes rule "ValueError: Cannot write empty DataFrame to file" and I could not find any related errors in the previous conversations, Can you please give me some hints on how to get over it?

Please find attached the log file for the error as well as my config.yaml file.

I am working on WSL Ubunto 18.04 on Windows.

Thank you very much for your help.
config.yaml.txt
error.txt

Fabian Neumann

unread,
Aug 3, 2021, 4:37:46 AM8/3/21
to Amir ElShennawi, pypsa
Hi Amir,

that's a good point. It seems that PyPSA-Eur is not currently able to
run if you only choose landlocked countries. We should fix that.

Unfortunately, I don't have a general quick fix, but I have opened an
issue for that:

https://github.com/PyPSA/pypsa-eur/issues/265

Best wishes,

Fabian N

--
Karlsruhe Institute of Technology (KIT)
Institute for Automation and Applied Informatics (IAI)

Fabian Neumann

www.neumann.fyi
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/7dfc2958-5a76-42eb-89a1-74aefd751d81n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/7dfc2958-5a76-42eb-89a1-74aefd751d81n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Amir ElShennawi

unread,
Aug 12, 2021, 6:39:32 AM8/12/21
to pypsa
Dear Fabian,

Thank you very much for your reply and I hope the issue would be resolved soon.

1) As for now, I added a non-landlocked country "Slovenia" to my configuration file and I was able to solve the network with no issue. (had to change no. of clusters to 40                 instead of 128 as I got an error saying 40 is the maximum for the selected countries)

2) However, while making a summary using (snakemake results/summaries/elec_s_40_ec_lcopt_Co2L-24H_AT) I get the following error:

     InputFunctionException in line 370 of /home/shennawi/pypsa-eur/Snakefile:
     Error:
       AttributeError: 'Wildcards' object has no attribute 'network'
     Wildcards:
       simpl=
       clusters=40
       ll=copt
       opts=Co2L-24H
       country=AT
     Traceback:
       File "/home/shennawi/pypsa-eur/Snakefile", line 364, in input_make_summary

3) I also want to plot the network using (snakemake results/plots/elec_s_40_ec_lcopt_Co2L-24H_AT.pdf) 
     I get an error because It reads attr=AT, not country=AT. How to plot results only for Austria?

I hope I am not wasting your time with silly errors.

Kind regards,
Amir
AT_SI config.yaml.txt

Fabian Neumann

unread,
Aug 12, 2021, 7:34:09 AM8/12/21
to Amir ElShennawi, pypsa
Hi Amir,

I can't make any promises as to whether we will be able to implement
support running land-locked countries only very soon.

The main challenge is that the workflow builds on having both onshore
and offshore shapes, so you need case distinctions that can deal with an
empty offshore shapes files.

Maybe you have the time to check this out?

For Slovenia, likely 40 nodes is the maximum transmission network
resolution (i.e. 40 high-voltage nodes). So 128 nodes won't work.

I can't help with the summary and plotting scripts, as they are due for
an overhaul and I haven't used them in a while. Maybe someone else on
the list?

Best wishes,

Fabian

--
Karlsruhe Institute of Technology (KIT)
Institute for Automation and Applied Informatics (IAI)

Fabian Neumann

www.neumann.fyi

> <https://groups.google.com/d/msgid/pypsa/7dfc2958-5a76-42eb-89a1-74aefd751d81n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pypsa/7dfc2958-5a76-42eb-89a1-74aefd751d81n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/88aaf00c-8bbd-45a8-af90-2cbfddd4dae0n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/88aaf00c-8bbd-45a8-af90-2cbfddd4dae0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Martha Maria F.

unread,
Aug 16, 2021, 12:09:35 PM8/16/21
to pypsa
Hi all,

the plot_network and make_summary rules in pypsa are currently not up to date. I tried to fix these issues in https://github.com/PyPSA/pypsa-eur/pull/270. Hope this helps.

For 3) your kwarg is not quite correct, try making the plot using snakemake -j all results/plots/elec_s_40_ec_lcopt_Co2L-24H_p_nom.pdf
If your network contains only AT as a country, the plot should be as you wish. However, if your network is for Europe but you want to plot only a certain region, you could specify the boundaris in your config.yaml to the country you want to plot, then the other regions will not appear (lines and links will be cut off in the graphic).

plotting:
  map:
    boundaries: [x1, x2, y1, y2]

Best, Martha
Reply all
Reply to author
Forward
0 new messages