Skip to content

install numpy for testing scripts #41

install numpy for testing scripts

install numpy for testing scripts #41

Workflow file for this run

name: Test
on:
push:
pull_request:
schedule:
- cron: '42 4 5,20 * *'
jobs:
Test:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3]
MPI: ['mpich', 'openmpi', 'no']
defaults:
run:
# this is needed, because otherwise conda env is not available
shell: bash -l {0}
steps:
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get -y --no-install-recommends install -y -qq libblas{3,-dev} liblapack{3,-dev} libatlas-base-dev cmake build-essential git gfortran
- name: Install openmpi
if: ${{ matrix.MPI == 'openmpi' }}
run: |
sudo apt-get install -qq openmpi-bin libopenmpi-dev python3-mpi4py
update-alternatives --list mpi|grep "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpi
update-alternatives --list mpirun|grep "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpirun
- name: Install mpich
if: ${{ matrix.MPI == 'mpich' }}
run: |
sudo apt-get install -qq mpich libmpich-dev python3-mpi4py
update-alternatives --list mpi|grep "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpi
update-alternatives --list mpirun|grep "${{ matrix.MPI }}" | xargs -rt sudo update-alternatives --set mpirun
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
python-version: ${{ matrix.python-version }}
#mamba-version: "*"
- name: Install mamba
run: conda install -y -c conda-forge mamba
- name: Install python dependencies
run: |
mamba install --quiet --file conda-requirements.txt corner coveralls numpy
pip install git+https://github.com/JohannesBuchner/coverage-lcov
#sed --in-place -e 's,"report_include",,g' -e 's,"report_omit",,g' /usr/share/miniconda/envs/*/lib/python*/site-packages/coverage_lcov/converter.py
conda list
conda info -a
- name: install mpi4py
if: ${{ matrix.MPI != 'no' }}
run: |
pip install --user mpi4py
python -c 'import mpi4py'
- name: Install MultiNest
run: |
git clone https://github.com/JohannesBuchner/MultiNest
mkdir -p MultiNest/build; pushd MultiNest/build; cmake .. && make && popd
test -e MultiNest/lib/libmultinest.so
echo LD_LIBRARY_PATH=MultiNest/lib/:${LD_LIBRARY_PATH} >> $GITHUB_ENV
echo RDMAV_FORK_SAFE=1 >> $GITHUB_ENV
- name: Install PyMultiNest
run: |
python setup.py install --user
- name: Test imports
run: |
python -c 'import pymultinest'
rm -rf chains/
- name: No-MPI tests
if: ${{ matrix.MPI == 'no' }}
run: |
# do not test pycuba, it is broken
rm tests/pycuba_test.py
coverage run setup.py test
coverage report
coverage-lcov
python pymultinest_demo_minimal.py
python pymultinest_demo.py
- name: MPI tests
if: ${{ matrix.MPI == 'openmpi' }}
run: |
mpiexec -np 4 --oversubscribe python pymultinest_demo_minimal.py
mpiexec -np 4 --oversubscribe python pymultinest_demo.py
- name: MPI tests
if: ${{ matrix.MPI == 'mpich' }}
run: |
mpiexec -np 4 python pymultinest_demo_minimal.py
mpiexec -np 4 python pymultinest_demo.py
- name: Long filename test
run: |
python tests/pymultinest_long_name_test.py;
- name: Marginal scripts test
run: |
python multinest_marginals.py chains/3-
python multinest_marginals_corner.py chains/3-
- name: Coveralls Finished
uses: coverallsapp/github-action@master
if: ${{ matrix.MPI == 'no' }}
with:
path-to-lcov: lcov.info
github-token: ${{ secrets.github_token }}
flag-name: MPI-${{ matrix.MPI }}
CondaTest:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
# this is needed, because otherwise conda env is not available
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
channels: conda-forge
python-version: ${{ matrix.python-version }}
environment-file: conda-requirements.txt
#mamba-version: "*"
- name: Install mamba
run: conda install -y -c conda-forge mamba
- name: Install dependencies
run: |
mamba install --quiet multinest
- name: Test imports
run: |
python -m pip install .
python -c 'import pymultinest'
- name: Tests
run: |
python pymultinest_demo_minimal.py