From 47d4882593d86e47dad70eba61b2d61b04420d38 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 7 Nov 2019 15:39:23 +0100 Subject: [PATCH] Testing on multiple operating systems with travis (#90) * multiple os travis * add coincbc via conda-forge * switch to glpk * circumvent windows subfolder snakemake path issue cf. snakemake/snakemake/#46 * travis: skip solving for windows --- .travis.yml | 28 ++++++++++------------------ config.tutorial.yaml | 4 ++-- test/config.test1.yaml | 4 ++-- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9df818fa..9ae6bf08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,25 @@ -language: python +os: + - windows + - linux + - osx -python: - - "3.7" +language: bash -install: - # install system utilities - - sudo apt-get update --fix-missing - - sudo apt-get install -yq --no-install-recommends curl bzip2 xz-utils git ca-certificates coinor-cbc - +before_install: # install conda - # https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - - bash miniconda.sh -b -p $HOME/miniconda - - source "$HOME/miniconda/etc/profile.d/conda.sh" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - - conda info -a + - wget https://raw.githubusercontent.com/trichter/conda4travis/latest/conda4travis.sh -O conda4travis.sh + - source conda4travis.sh # install conda environment - conda env create -f ./environment.yaml - conda activate pypsa-eur # install open-source solver - - conda install -c conda-forge ipopt + - conda install -c conda-forge ipopt glpk script: - cp ./test/config.test1.yaml ./config.yaml - snakemake - - snakemake results/networks/elec_s_6_lcopt_Co2L-24H.nc + - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then snakemake solve_all_elec_networks; fi - rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results # could repeat for more configurations in future diff --git a/config.tutorial.yaml b/config.tutorial.yaml index 0242438b..6a22356c 100644 --- a/config.tutorial.yaml +++ b/config.tutorial.yaml @@ -8,7 +8,7 @@ scenario: sectors: [E] simpl: [''] ll: ['copt'] - clusters: [2,6] + clusters: [5] opts: [Co2L-24H] countries: ['DE'] @@ -158,7 +158,7 @@ solving: clip_p_max_pu: 0.01 #nhours: 10 solver: - name: ipopt + name: glpk # solver: # name: gurobi # threads: 4 diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 8cc0b4f7..98343453 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -9,7 +9,7 @@ scenario: simpl: [''] ll: ['copt'] clusters: [5] - opts: [Co2L-24H, 24H] + opts: [Co2L-24H] countries: ['DE'] @@ -158,7 +158,7 @@ solving: clip_p_max_pu: 0.01 #nhours: 10 solver: - name: cbc + name: glpk # solver: # name: gurobi # threads: 4