pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
19 stars 16 forks source link

Round error in build_base_energy_totals #263

Closed doneachh closed 5 months ago

doneachh commented 5 months ago

Checklist

Describe the Bug

.round(4) doesnt work for floats, has to be changed to round(df_sector[df_sector.Commodity.isin(heat)] .Quantity_TWh.sum(), 4)

Error Message

Traceback (most recent call last): File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpabw5dl6e.build_base_energy_totals.py", line 379, in calc_sector(sector) File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpabw5dl6e.build_base_energy_totals.py", line 119, in calc_sector .round(4) AttributeError: 'float' object has no attribute 'round' [Thu Jan 18 18:48:29 2024] INFO:snakemake.logging:[Thu Jan 18 18:48:29 2024] Error in rule build_base_energy_totals: jobid: 8 input: data/demand/unsd/paths/Energy_Statistics_Database.xlsx output: data/energy_totals_base.csv

ERROR:snakemake.logging:Error in rule build_base_energy_totals: jobid: 8 input: data/demand/unsd/paths/Energy_Statistics_Database.xlsx output: data/energy_totals_base.csv

RuleException: CalledProcessError in file /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile, line 279: Command 'set -euo pipefail; /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpabw5dl6e.build_base_energy_totals.py' returned non-zero exit status 1. File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile", line 279, in __rule_build_base_energy_totals File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run ERROR:snakemake.logging:RuleException: CalledProcessError in file /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile, line 279: Command 'set -euo pipefail; /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpabw5dl6e.build_base_energy_totals.py' returned non-zero exit status 1. File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile", line 279, in __rule_build_base_energy_totals File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run