From 7479ba0424ad95d531094ee7313d76e83e05c281 Mon Sep 17 00:00:00 2001 From: martavp Date: Wed, 30 Dec 2020 12:14:08 +0100 Subject: [PATCH] Fix unicode error due to dash before sawdust A quick fix to https://github.com/PyPSA/pypsa-eur-sec/issues/79 --- config.default.yaml | 2 +- scripts/build_biomass_potentials.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index d43d0e29..7907859a 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -69,7 +69,7 @@ biomass: year: 2030 scenario: "Med" classes: - solid biomass: ['Primary agricultural residues', 'Forestry energy residue', 'Secondary forestry residues', 'Secondary Forestry residues – sawdust', 'Forestry residues from landscape care biomass', 'Municipal waste'] + solid biomass: ['Primary agricultural residues', 'Forestry energy residue', 'Secondary forestry residues', 'Secondary Forestry residues sawdust', 'Forestry residues from landscape care biomass', 'Municipal waste'] not included: ['Bioethanol sugar beet biomass', 'Rapeseeds for biodiesel', 'sunflower and soya for Biodiesel', 'Starchy crops biomass', 'Grassy crops biomass', 'Willow biomass', 'Poplar biomass potential', 'Roundwood fuelwood', 'Roundwood Chips & Pellets'] biogas: ['Manure biomass potential', 'Sludge biomass'] diff --git a/scripts/build_biomass_potentials.py b/scripts/build_biomass_potentials.py index c959680f..44fd04b5 100644 --- a/scripts/build_biomass_potentials.py +++ b/scripts/build_biomass_potentials.py @@ -1,3 +1,4 @@ +# coding: utf-8 import pandas as pd @@ -57,7 +58,12 @@ if __name__ == "__main__": snakemake.input['jrc_potentials'] = "data/biomass/JRC Biomass Potentials.xlsx" snakemake.output = Dict() snakemake.output['biomass_potentials'] = 'data/biomass_potentials.csv' + snakemake.output['biomass_potentials_all']='resources/biomass_potentials_all.csv' with open('config.yaml', encoding='utf8') as f: snakemake.config = yaml.safe_load(f) - + + if 'Secondary Forestry residues sawdust' in snakemake.config['biomass']['classes']['solid biomass']: + snakemake.config['biomass']['classes']['solid biomass'].remove('Secondary Forestry residues sawdust') + snakemake.config['biomass']['classes']['solid biomass'].append('Secondary Forestry residues – sawdust') + build_biomass_potentials()