From 5dc572c35e166e8e3aaacc03bb58d36b1288cd1e Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Wed, 4 Mar 2020 18:10:57 +0100 Subject: [PATCH] solve_network.py: Remove hacked installation of conda libraries --- README.md | 7 ++----- Snakefile | 4 ++-- config.yaml | 4 ++-- scripts/solve_network.py | 11 ----------- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d3292e2a..200cc580 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,8 @@ projects % git clone git@github.com:nworbmot/pypsa-eur-sec.git The requirements are the same as [PyPSA-Eur](https://github.com/PyPSA/pypsa-eur), but for -`solve_network.py` in addition you need `gurobipy` and version 0.16.0 -or greater of PyPSA in order to use the `nomopyomo` framework. These -libraries are currently imported "by hand" at the start of the -`solve_network.py` script. - +`solve_network.py` in addition you need `gurobipy` and version 0.16.1 +or greater of PyPSA in order to use the `nomopyomo` framework. ## Data requirements diff --git a/Snakefile b/Snakefile index 0ab03d3f..f3e99a86 100644 --- a/Snakefile +++ b/Snakefile @@ -172,7 +172,7 @@ rule build_industrial_demand: rule prepare_sector_network: input: - network=pypsaeur('networks/{network}_s{simpl}_{clusters}_ec_lv{lv}_{opts}.nc'), + network=pypsaeur('networks/{network}_s{simpl}_{clusters}_lv{lv}_{opts}.nc'), energy_totals_name='data/energy_totals.csv', co2_totals_name='data/co2_totals.csv', transport_name='data/transport_data.csv', @@ -219,7 +219,7 @@ rule solve_network: memory="logs/" + config['run'] + "/{network}_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_memory.log" benchmark: "benchmarks/solve_network/{network}_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}" threads: 4 - resources: mem=20000 #memory in MB; 40 GB enough for 45+B+I; 100 GB based on RESI usage for 128 + resources: mem=100000 #memory in MB; 40 GB enough for 45+B+I; 100 GB based on RESI usage for 128 # group: "solve" # with group, threads is ignored https://bitbucket.org/snakemake/snakemake/issues/971/group-job-description-does-not-contain script: "scripts/solve_network.py" diff --git a/config.yaml b/config.yaml index 58d402d5..901827e6 100644 --- a/config.yaml +++ b/config.yaml @@ -2,7 +2,7 @@ logging_level: INFO results_dir: 'results/' summary_dir: results -run: '191222-181-lv' +run: '200126-181-lv-solar3' scenario: sectors: [E] # ,E+EV,E+BEV,E+BEV+V2G] # [ E+EV, E+BEV, E+BEV+V2G ] @@ -10,7 +10,7 @@ scenario: lv: [1.0, 1.125, 1.25, 1.5, 2.0]# or opt clusters: [181] #[90, 128, 181] #[45, 64, 90, 128, 181, 256] #, 362] # (2**np.r_[5.5:9:.5]).astype(int) minimum is 37 opts: [''] #for pypsa-eur - sector_opts: [Co2L0-3H-T-H-B-I]#Co2L0-3H-T-H-B-I-onwind0-solar3,Co2L0-3H-T-H-B-I-onwind0p125-solar3,Co2L0-3H-T-H-B-I-onwind0p25-solar3,Co2L0-3H-T-H-B-I-onwind0p50-solar3,Co2L0-3H-T-H-B-I-solar3]#[Co2L0-3H-T-H-B-I]#,Co2L0p2-3H-T-H-B-I,Co2L0p5-3H-T-H-B-I]#,Co2L0p1-3H-T-H-B-I,Co2L0p25-3H-T-H-B-I,Co2L0p5-3H-T-H-B-I]#[Co2L0-3H-T-H-B-I-onwind0-solar3,Co2L0-3H-T-H-B-I-onwind0p125-solar3,Co2L0-3H-T-H-B-I-onwind0p25-solar3,Co2L0-3H-T-H-B-I-onwind0p50-solar3,Co2L0-3H-T-H-B-I-solar3]#,Co2L0-3H-T-H-B-I-onwind0p25-solar3]#,Co2L0p05-3H-T-H-B-I,Co2L0p10-3H-T-H-B-I,Co2L0p20-3H-T-H-B-I,Co2L0p30-3H-T-H-B-I,Co2L0p50-3H-T-H-B-I]#[Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0-3H-T-H,Co2L0p20-3H-T-H] #Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p20-3H-T-HCo2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p30-3H-T-H,Co2L0p50-3H-T-H] #Co2L-3H,Co2L-3H-T,, LC-FL, LC-T, Ep-T, Co2L-T] + sector_opts: [Co2L0-3H-T-H-B-I-solar3]#Co2L0-3H-T-H-B-I-onwind0-solar3,Co2L0-3H-T-H-B-I-onwind0p125-solar3,Co2L0-3H-T-H-B-I-onwind0p25-solar3,Co2L0-3H-T-H-B-I-onwind0p50-solar3,Co2L0-3H-T-H-B-I-solar3]#[Co2L0-3H-T-H-B-I]#,Co2L0p2-3H-T-H-B-I,Co2L0p5-3H-T-H-B-I]#,Co2L0p1-3H-T-H-B-I,Co2L0p25-3H-T-H-B-I,Co2L0p5-3H-T-H-B-I]#[Co2L0-3H-T-H-B-I-onwind0-solar3,Co2L0-3H-T-H-B-I-onwind0p125-solar3,Co2L0-3H-T-H-B-I-onwind0p25-solar3,Co2L0-3H-T-H-B-I-onwind0p50-solar3,Co2L0-3H-T-H-B-I-solar3]#,Co2L0-3H-T-H-B-I-onwind0p25-solar3]#,Co2L0p05-3H-T-H-B-I,Co2L0p10-3H-T-H-B-I,Co2L0p20-3H-T-H-B-I,Co2L0p30-3H-T-H-B-I,Co2L0p50-3H-T-H-B-I]#[Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0-3H-T-H,Co2L0p20-3H-T-H] #Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p20-3H-T-HCo2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p30-3H-T-H,Co2L0p50-3H-T-H] #Co2L-3H,Co2L-3H-T,, LC-FL, LC-T, Ep-T, Co2L-T] # Co2L will give default (5%); Co2L0p25 will give 25% CO2 emissions; Co2Lm0p05 will give 5% negative emissions diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 0267fdfb..7b0a24a7 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -1,14 +1,3 @@ -import os - -os.system("conda install -y -c gurobi gurobi=8.1.0") - -os.system("conda install -y -c conda-forge pypsa=0.16.1") - -#import sys - -#sys.path = ["pypsa"] + sys.path - - import numpy as np import pandas as pd