forked from CobayaSampler/cobaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
164 lines (157 loc) · 7.24 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
language: python
os: linux
dist: bionic
git:
depth: false
#testing
env:
global:
- COBAYA_INSTALL_SKIP=polychord,planck_2015,CamSpec,unbinned
#Large CamSpec folders tend to hang, so exclude non-base likelihoods from cache
cache:
directories:
- /home/travis/build/CosmoPars/packages/code
- /home/travis/build/CosmoPars/packages/data/planck_supp_data_and_covmats
- /home/travis/build/CosmoPars/packages/data/planck_2018/baseline
- /home/travis/build/CosmoPars/packages/data/bicep_keck_2018
- /home/travis/build/CosmoPars/packages/data/bao_data
- /home/travis/build/CosmoPars/packages/data/sn_data
- /home/travis/build/CosmoPars/packages/data/des_data
- /home/travis/build/CosmoPars/packages/data/planck_2018_pliklite_native
- /home/travis/build/CosmoPars/packages/data/planck_2018_lowE_native
# (Pre)Installation
jobs:
include:
- name: "Minimum requisites for Cosmology: gcc-6, Python 3.6"
addons:
apt:
packages:
- gcc-6
- gfortran-6
env:
- GCC_VERSION="6"
python: "3.6"
- name: "Typical scenario: latest Ubuntu LTS"
dist: focal
addons:
apt:
packages:
- gfortran
env:
- GCC_VERSION="ubuntu"
python: "3.8"
- name: "Anaconda: gcc-8, Python 3.7"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- gfortran-8
- g++-8
env:
- GCC_VERSION="8"
- PYDIST="ANACONDA"
- ANACONDA_CHANNEL="defaults"
python: "3.7"
- name: "Latest: gcc-11, Python 3.10 Anaconda (conda-forge)"
dist: focal
addons:
apt:
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
packages:
- gcc-11
- gfortran-11
- g++-11
env:
- GCC_VERSION="11"
- PYDIST="ANACONDA"
- ANACONDA_CHANNEL="conda-forge"
python: "3.10"
allow_failures:
- name: "Latest: gcc-11, Python 3.10 Anaconda (conda-forge)"
before_install:
# Configure right compiler versions
- if [[ "$GCC_VERSION" != "ubuntu" ]]; then
mkdir -p gcc-symlinks;
ln -s /usr/bin/gfortran-$GCC_VERSION gcc-symlinks/gfortran;
ln -s /usr/bin/gcc-$GCC_VERSION gcc-symlinks/gcc;
ln -s /usr/bin/g++-$GCC_VERSION gcc-symlinks/g++;
export PATH=$PWD/gcc-symlinks:$PATH;
fi
- if [[ "$GCC_VERSION" == "11" ]]; then
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgfortran.so.5;
fi
- if [[ "$GCC_VERSION" == "6" ]]; then
export COBAYA_INSTALL_SKIP=$COBAYA_INSTALL_SKIP,polychord;
fi
- gfortran --version
# Install rest of system requisites
- sudo apt install openmpi-bin openmpi-common libopenmpi-dev libopenblas-dev liblapack-dev
# Python requisites
- if [[ "$PYDIST" == "ANACONDA" ]]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda info -a;
conda create -q -n test-environment -c $ANACONDA_CHANNEL python=$TRAVIS_PYTHON_VERSION scipy matplotlib cython PyYAML pytest pytest-forked pytest-cov flaky dill coverage flake8;
source activate test-environment;
pip install mpi4py;
else
pip install mpi4py pytest-forked pytest-cov flaky matplotlib dill coverage flake8;
fi
- python -m pip install --upgrade pip
- python --version
script:
# Find undeclared references and syntax errors, plus standardize whitespace etc;
# See https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
- flake8 cobaya --select=E713,E704,E703,E714,E741,E10,E11,E20,E22,E23,E25,E27,E301,E302,E304,E9,F405,F406,F5,F6,F7,F8,W1,W2,W3,W6 --show-source --statistics
# General tests:
- export COBAYA_PACKAGES_PATH="../packages"
- coverage run --parallel-mode -m cobaya.install polychord --debug
- coverage run --parallel-mode -m pytest tests/ -k "not cosmo" --skip-not-installed --no-flaky-report
- pip install numba
# Cosmology tests:
- coverage run --parallel-mode -m cobaya.install cosmo-tests --no-progress-bars --debug
- if [ -n "${CAMB_BRANCH}" ]; then
rm -rf $COBAYA_PACKAGES_PATH/code/CAMB ;
git clone --recursive --depth 1 -b $CAMB_BRANCH https://github.com/cmbant/CAMB $COBAYA_PACKAGES_PATH/code/CAMB ;
python $COBAYA_PACKAGES_PATH/code/CAMB/setup.py build ;
fi
# mpi tests [not sure why it hangs in py3.6]
- if [[ "$GCC_VERSION" != "6" ]]; then
mpiexec -np 2 --mca orte_base_help_aggregate 0 --mca btl ^openib --oversubscribe coverage run --parallel-mode -m pytest -x -m mpi tests/ --no-flaky-report ;
fi;
- mkdir covers; mv .coverage.* covers; ls -ltra covers
- pytest tests/ --cov -v -s -k "cosmo" --forked --skip-not-installed --no-flaky-report
- mv .coverage .coverage.pytest; mv covers/.cov* .
# Test external cosmological likelihoods
- python $COBAYA_PACKAGES_PATH/code/CAMB/setup.py install
- git clone --depth=1 https://github.com/CobayaSampler/planck_lensing_external
- pip install ./planck_lensing_external --quiet
- coverage run --parallel-mode -m unittest plancklensing.tests.test_likes
- git clone --depth=1 https://github.com/CobayaSampler/example_external_likelihood
- pip install ./example_external_likelihood --quiet
- coverage run --parallel-mode -m unittest test_package.tests.test
after_success:
- bash <(curl -s https://codecov.io/bash)
###############################################################################
deploy: # only if it builds and if the commit has been tagged
provider: pypi
username: JesusTorrado
password:
secure: FVCgqGT0sMJyvlY3sJFBwvO4RycAbWbVyHl4p9CG7XRSSgVOLGy9RZjAJkX8dJjH06fPNdQDYfkkj1PV8I42y0n4uqKkQ9RB63Yq6skbuuzjXLGQK9Xop10/1GDBhMHietDibzl8ZIuJyibdFYsc3rM/j8QcKjOYpDe10jO8K+dZaXsgAvqHk4P3d3ScG1u+X+wr8K6qik21YbTpiILS0LdUxmP4DWQw/7NKGWDX1b7sImRmvQfO20KuPTMu8pPz9ThZyPl6zEPgtKi2sQej5sgDlfim/heYk4W8Bf7bggS8GLseffssL5ru96eNUWT1OSbxnsEFqyyYepngNHPpvifflvtCiFU+3f7rzzcgYqmybhdM4ZEOk0pL5y/NS/rHn/1iW7Cqxs+GfUCbr9fWuBgKmVuDqEfvtSu83U1x6zz9C3R259Oe6n0vXfCGSfJqiHhsW8wuXx+bODyDaMAUn+gRSCLuqJVQzdcYwF2pGFf1WUH5iTQItUHZjYbAIXdnSqDKnvGalNDJdNsF3vwNEdbe8hFqfHMMzG73ZkkLOCjDW+mswIKYJUflxIyOdRqtB+XE056dA+c8Zwc4ktg4iss/O3ZBtUVPmba/ivpyYm7Fk8EUN/zY+24NK4iKk6z543rfx2w+wNXAuQiwgN2f+JshqI8kzTuCxPTgf2N49ME=
on:
tags: true
python: '3.8'
condition: "$GCC_VERSION != 6"
branch: master
repo: CobayaSampler/cobaya
###############################################################################
notifications:
email:
recipients:
- secure: wWS2J0Q413dLa415/iDn/rzwjFjnhCsGogxJeLW64/59NwaXV+spQZvgwfM+dKFt6kEvKZ4yPE+zXOgcpjp5lLSSWoJCaZy3q6rm7qEAEXxJCtH/4yMuLI0nWNxQRqVaOEq7q8e8jppQ/PBIUiqiT3EQlcNqagMReQEhr+M7hKtVnmA4XiFxmrp1H8aWhVvZWPWLPNtafPLX5CA2Ch3CJ09t591N3baZR0yOWwtEDeBZAHjbswTkNCVR6daUmOdbpFFti/Pdj7YmH1WkFTuEqfwuZiRJBrmyOGlARJZ4PybDK6npBXP393W2663TTIx0M4hT98YupWDXhC87WYAICBasySShxt/2lN2wqseHQlnfzPzmurZpim9choX5iDd/TTPyvhBk/xxT5G6RCeq2/vWwwWa4Owe20T2ep+8pYl0x9sNZyS+C67MOWsIs66dWEPxS4fOgsb6lBST9A8pv2Mfr5DHW8OLGAiIXI9mkeOqZkxlTxywQ5kKAO8hPkmzI7TrGH5drMkJDMqdGZSVC0f7y82RfQFLiv5aQp/xFkZKW7FzMi8DYBHJLfelpszfzyCeibQxQR7aPk6r6UbZhMw9Bd9KVpOV9Ag3EZ44MuVIDxA688cmdka4Swjw2VMWhTYQNGF1mB5WfsgtXfzpA8st7YZZJaysy+iXeoPML+is=