[pypsa-eur] Missing rule exception for solve_network job

106 views
Skip to first unread message

Martin Roach

unread,
Mar 10, 2023, 6:45:42 AM3/10/23
to pypsa
Hi all,

I'm new to pypsa-eur, but have read through the documentation and looked for an answer in previous conversations here. My problem is even with the most basic scenario, the solve_network job doesn't appear.

Whether I use: 
snakemake -j 1 solver_all_networks
snakemake -call results/networks/elec_s_37_ec_l_24H.nc

I get the following error:
(pypsa-eur) roac1409@martin:~/pypsa-eur$ snakemake -call results/networks/elec_s_37_ec_l_24H.nc
Building DAG of jobs...
MissingRuleException:
No rule to produce results/networks/elec_s_37_ec_l_24H.nc (if you use input functions make sure that they don't raise unexpected exceptions).

When I try to see what jobs will be run, solve_network is missing: 
(pypsa-eur) roac1409@martin:~/pypsa-eur$ snakemake -n
Building DAG of jobs...
Job stats:
job                         count    min threads    max threads
------------------------  -------  -------------  -------------
add_electricity                 1              1              1
base_network                    1              1              1
build_bus_regions               1              1              1
build_hydro_profile             1              1              1
build_load_data                 1              1              1
build_powerplants               1              1              1
build_renewable_profiles        4              1              1
build_shapes                    1              1              1
build_ship_raster               1              1              1
cluster_all_networks            1              1              1
cluster_network                 1              1              1
retrieve_cost_data              1              1              1
retrieve_cutout                 1              1              1
retrieve_natura_raster          1              1              1
simplify_network                1              1              1
total                          18              1              1


Any thoughts or help on what to investigate further is much appreciated, thanks in advance! 

Best regards,
Martin Roach


config.yaml

Fabian Neumann

unread,
Mar 10, 2023, 6:51:02 AM3/10/23
to pypsa
Hi Martin,

The default target of the workflow stops just before the solving.

You have to specify that you want to solve the networks as well:

snakemake -c all solve_all_networks

Best wishes,

Fabian
Message has been deleted

Fabian Neumann

unread,
Mar 10, 2023, 11:51:19 AM3/10/23
to pypsa
Hi Martin,

your {ll} wildcard cannot be an empty string. It could be for example 'vopt' or 'v1.0'. E.g.

results/networks/elec_s_37_ec_lvopt_24H.nc

Best wishes,

Fabian N

On Friday, 10 March 2023 at 17:24:38 UTC+1 roac...@gmail.com wrote:
Hi Fabian,

Thanks for the advice, unfortunately I run into the same error:

(pypsa-eur) roac1409@martin:~/pypsa-eur$ snakemake -c all solve_all_networks
Building DAG of jobs...
MissingInputException in rule solve_all_networks in file /home/roac1409/pypsa-eur/Snakefile, line 54:
Missing input files for rule solve_all_networks:
    affected files:
        results/networks/elec_s_37_ec_l_24H.nc

When I run only snakemake, it builds out the networks no problem: base.nc  elec.nc  elec_s.nc  elec_s_37.nc

With these, I thought maybe I could call the output file, but also didn't work. I'll dive into how snakemake works because I've mainly looked at the configuration. 

Best regards,
Martin

Martin Roach

unread,
Mar 10, 2023, 11:59:07 AM3/10/23
to pypsa
Hi Fabian,

Many thanks! 

Cheers,
Martin

Reply all
Reply to author
Forward
0 new messages