Skip to content

Add ConvolvePSF type #335

Add ConvolvePSF type

Add ConvolvePSF type #335

Workflow file for this run

name: Piff CI
on:
push:
branches:
- main
- releases/*
pull_request:
branches:
- main
- releases/*
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# First all python versions in basic linux
os: [ ubuntu-latest ]
py: [ 3.7, 3.8, 3.9, "3.10", 3.11, 3.12 ]
CC: [ gcc ]
CXX: [ g++ ]
# Add some other particular combinations to test
include:
# A couple in MacOS
- os: macos-latest
py: "3.10"
CC: cc
CXX: c++
# Check one with clang compiler
- os: ubuntu-latest
py: 3.11
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v3
with:
# Helpful for a reliable codecov upload.
fetch-depth: 0
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.py }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.py }}-pip-
${{ runner.os }}-
- name: Install libfftw, etc. on linux (needed for GalSim)
if: matrix.os == 'ubuntu-latest'
run: |
echo ${{ matrix.os }}
sudo -H apt-get -qq update
sudo -H apt-get install -y libfftw3-dev libeigen3-dev
- name: Install libfftw, etc. on MacOS
if: matrix.os == 'macos-latest'
run: |
echo ${{ matrix.os }}
brew update || true
brew install fftw eigen || true
brew link --overwrite fftw eigen || true
brew unlink fftw && brew link fftw || true
brew unlink eigen && brew link eigen || true
ls /opt/homebrew/Cellar/fftw/3.3.10_1/
ls /opt/homebrew/Cellar/fftw/3.3.10_1/*
ls /opt/homebrew/lib/
export FFTW_DIR=/opt/homebrew/lib/
export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/homebrew/lib/
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/homebrew/lib/
- name: Install dependencies with pip
run: |
python -m pip install -U pip
# Do these first to clarify potential conflicts
pip install -U setuptools numpy
# Standard dependencies
pip install -U -r requirements.txt
# Extra packages needed for testing
# Note: Pin pillow <10 until this bug is fixed:
# https://github.com/python-pillow/Pillow/issues/7259
pip install -U nose coverage "pytest<8" nbval ipykernel "pillow<10"
- name: Install Pixmappy (not on pip)
run: |
git clone https://github.com/gbernstein/pixmappy.git
cd pixmappy
pip install -vvv .
cd ..
- name: List all installed packages for reference
run: pip list
- name: Enable Agg backend
# The .matplotlib file needs to be in $HOME to work right.
run: |
cp -r tests/.matplotlib $HOME
- name: Build Piff
run: pip install -vvv .
- name: Run unit tests
run: |
cd tests
coverage run -m pytest -v
coverage combine
coverage xml
ls -lsart
cd .. # N.B. This seems to happen automatically if omitted.
# Less confusing to include it explicitly.
- name: Test Tutorial notebook
if: matrix.py == 3.9
run: |
cd examples
pytest --nbval Tutorial.ipynb --sanitize-with sanitize.cfg --current-env
cd ..
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: tests/coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)