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
This commit is contained in:
Fabian Neumann 2019-11-07 15:39:23 +01:00 committed by GitHub
parent e54119d878
commit 47d4882593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 22 deletions

View File

@ -1,33 +1,25 @@
language: python os:
- windows
- linux
- osx
python: language: bash
- "3.7"
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 # install conda
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html - wget https://raw.githubusercontent.com/trichter/conda4travis/latest/conda4travis.sh -O conda4travis.sh
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - source conda4travis.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
# install conda environment # install conda environment
- conda env create -f ./environment.yaml - conda env create -f ./environment.yaml
- conda activate pypsa-eur - conda activate pypsa-eur
# install open-source solver # install open-source solver
- conda install -c conda-forge ipopt - conda install -c conda-forge ipopt glpk
script: script:
- cp ./test/config.test1.yaml ./config.yaml - cp ./test/config.test1.yaml ./config.yaml
- snakemake - 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 - rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results
# could repeat for more configurations in future # could repeat for more configurations in future

View File

@ -8,7 +8,7 @@ scenario:
sectors: [E] sectors: [E]
simpl: [''] simpl: ['']
ll: ['copt'] ll: ['copt']
clusters: [2,6] clusters: [5]
opts: [Co2L-24H] opts: [Co2L-24H]
countries: ['DE'] countries: ['DE']
@ -158,7 +158,7 @@ solving:
clip_p_max_pu: 0.01 clip_p_max_pu: 0.01
#nhours: 10 #nhours: 10
solver: solver:
name: ipopt name: glpk
# solver: # solver:
# name: gurobi # name: gurobi
# threads: 4 # threads: 4

View File

@ -9,7 +9,7 @@ scenario:
simpl: [''] simpl: ['']
ll: ['copt'] ll: ['copt']
clusters: [5] clusters: [5]
opts: [Co2L-24H, 24H] opts: [Co2L-24H]
countries: ['DE'] countries: ['DE']
@ -158,7 +158,7 @@ solving:
clip_p_max_pu: 0.01 clip_p_max_pu: 0.01
#nhours: 10 #nhours: 10
solver: solver:
name: cbc name: glpk
# solver: # solver:
# name: gurobi # name: gurobi
# threads: 4 # threads: 4