pypsa-eur rule plot_summary error

96 views
Skip to first unread message

Jiangyi Huang

unread,
Sep 28, 2022, 2:57:32 PM9/28/22
to pypsa
Hi,

I tried calling the `plot_summary` rule and got the following error:

```
(pypsa-eur) hjy@mavt-esa-n105w:/mnt/c/Projects/NorthSeaSectorCoupling/PyPSA_SysModel/pypsa-eur$ snakemake -j 1 results/plots/summary_energy_elec_s_6_ec_lcopt_Co2L-24H_all.pdf
Restricted license - for non-production use only - expires 2023-10-25
No parameters matching '_test' found
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job             count    min threads    max threads
------------  -------  -------------  -------------
plot_summary        1              1              1
total               1              1              1

Select jobs to execute...

[Wed Sep 28 20:24:46 2022]
rule plot_summary:
    input: results/summaries/elec_s_6_ec_lcopt_Co2L-24H_all
    output: results/plots/summary_energy_elec_s_6_ec_lcopt_Co2L-24H_all.pdf
    log: logs/plot_summary/energy_elec_s_6_ec_lcopt_Co2L-24H_all_pdf.log
    jobid: 0
    reason: Missing output files: results/plots/summary_energy_elec_s_6_ec_lcopt_Co2L-24H_all.pdf
    wildcards: summary=energy, simpl=, clusters=6, ll=copt, opts=Co2L-24H, country=all, ext=pdf
    resources: tmpdir=/tmp, mem_mb=500

dropping
clusters                 6
ll                    copt
opts              Co2L-24H
CCGT              0.674659
OCGT              6.757139
battery storage   0.000000
coal              0.381372
hydrogen storage  0.000000
lines             0.000000
offshore wind ac  0.000000
offshore wind dc  0.000000
onshore wind      0.000000
solar PV          0.000000
clusters  ll    opts
6         copt  Co2L-24H    0.0
dtype: float64
Traceback (most recent call last):
  File "/mnt/c/Projects/NorthSeaSectorCoupling/PyPSA_SysModel/pypsa-eur/.snakemake/scripts/tmpqcby1kup.plot_summary.py", line 218, in <module>
    func(
  File "/mnt/c/Projects/NorthSeaSectorCoupling/PyPSA_SysModel/pypsa-eur/.snakemake/scripts/tmpqcby1kup.plot_summary.py", line 165, in plot_energy
    df.loc[new_index, new_columns].T.plot(
  File "/home/hjy/miniconda3/envs/pypsa-eur/lib/python3.10/site-packages/pandas/plotting/_core.py", line 1001, in __call__
    return plot_backend.plot(data, kind=kind, **kwargs)
  File "/home/hjy/miniconda3/envs/pypsa-eur/lib/python3.10/site-packages/pandas/plotting/_matplotlib/__init__.py", line 71, in plot
    plot_obj.generate()
  File "/home/hjy/miniconda3/envs/pypsa-eur/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py", line 451, in generate
    self._compute_plot_data()
  File "/home/hjy/miniconda3/envs/pypsa-eur/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py", line 636, in _compute_plot_data
    raise TypeError("no numeric data to plot")
TypeError: no numeric data to plot
[Wed Sep 28 20:24:47 2022]
Error in rule plot_summary:
    jobid: 0
    output: results/plots/summary_energy_elec_s_6_ec_lcopt_Co2L-24H_all.pdf
    log: logs/plot_summary/energy_elec_s_6_ec_lcopt_Co2L-24H_all_pdf.log (check log file(s) for error message)

RuleException:
CalledProcessErrorin line 681 of /mnt/c/Projects/NorthSeaSectorCoupling/PyPSA_SysModel/pypsa-eur/Snakefile:
Command 'set -euo pipefail;  /home/hjy/miniconda3/envs/pypsa-eur/bin/python3.10 /mnt/c/Projects/NorthSeaSectorCoupling/PyPSA_SysModel/pypsa-eur/.snakemake/scripts/tmpqcby1kup.plot_summary.py' returned non-zero exit status 1.
  File "/mnt/c/Projects/NorthSeaSectorCoupling/PyPSA_SysModel/pypsa-eur/Snakefile", line 681, in __rule_plot_summary
  File "/home/hjy/miniconda3/envs/pypsa-eur/lib/python3.10/concurrent/futures/thread.py", line 58, in run
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
```

It seems to be the problem of the corresponding python script if I implemented the code correctly. Can someone help? Thanks in advance!

Best,
Jiangyi 

Jiangyi Huang

unread,
Oct 5, 2022, 11:23:13 AM10/5/22
to pypsa
Is anybody willing to spare a few minutes to examine the snakemake rule in trouble?
Reply all
Reply to author
Forward
0 new messages