Skip to content

Commit

Permalink
Transition to Github Actions (soft-matter#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervdw authored Feb 21, 2021
1 parent d394ef8 commit 1776898
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 62 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Conda

on: [push, pull_request]

jobs:
TestConda:
name: ${{ matrix.os }} - ${{ matrix.channel || 'defaults' }} - Python ${{ matrix.python }} (GEOS ${{ matrix.geos || 'latest' }}, numpy ${{ matrix.numpy || 'latest' }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [3.8]

steps:
- uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/[email protected]
with:
activate-conda: false
conda-channels: conda-forge

- name: Setup Environment
shell: bash
run: |
conda create --name test python=${{ matrix.python }} pytest numpy scipy matplotlib pillow pandas scikit-image pytables numba scikit-learn pyyaml
source activate test
python -V
conda info
conda list
- name: Run tests
shell: bash
run: |
source activate test
pytest trackpy
74 changes: 74 additions & 0 deletions .github/workflows/test-pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Pip

on: [push, pull_request]

jobs:
TestLinux:
name: Python ${{ matrix.python }} ${{ matrix.display_name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# "Legacy" environments: oldest supported versions, without and with optional dependencies
- python: 3.5
display_name: "no optional deps"
numpy: "numpy==1.13.*"
deps: "scipy==0.19.* matplotlib==2.0.* pandas==0.20.* pyyaml"
- python: 3.5
display_name: "no numba"
numpy: "numpy==1.13.*"
deps: "scipy==0.19.* matplotlib==2.0.* pillow==4.2.* pandas==0.20.* scikit-image==0.13.* tables==3.3.* scikit-learn==0.19.* pyyaml==3.12"
# 2017
- python: 3.6
numpy: "numpy==1.14.*"
deps: "scipy==1.1.* matplotlib==2.1.* pillow==4.3.* pandas==0.22.* scikit-image==0.13.* tables==3.4.* scikit-learn==0.19.* pyyaml==3.12 numba==0.32.* llvmlite==0.17.*"
# 2018
- python: 3.7
numpy: "numpy==1.16.*"
deps: "scipy==1.3.* matplotlib==2.2.* pillow==5.3.* pandas==0.23.* scikit-image==0.14.* tables==3.5.* scikit-learn==0.20.* pyyaml==3.13 numba==0.39.* llvmlite==0.24."
# 2019
- python: 3.8
numpy: "numpy==1.18.*"
deps: "scipy==1.4.* matplotlib==3.1.* pillow==6.2.* pandas==0.25.* scikit-image==0.16.* tables==3.6.* scikit-learn==0.22.* pyyaml==5.3.* numba==0.47.* llvmlite==0.31.*"
# 2020
- python: 3.9
numpy: "numpy==1.19.*"
deps: "scipy==1.5.* matplotlib==3.3.* pillow==8.0.* pandas==1.1.* scikit-image==0.18.* tables==3.6.* scikit-learn==0.24.* pyyaml==5.4.* numba==0.53rc1.post1 llvmlite==0.36rc1"
# most recent
- python: '3.x'
display_name: "latest, no numba"
numpy: "numpy"
deps: "scipy matplotlib pillow pandas scikit-image tables scikit-learn pyyaml"
# most recent
- python: '3.x'
display_name: "pre-releases"
numpy: "--pre numpy"
deps: "--pre scipy matplotlib pillow pandas scikit-image tables scikit-learn pyyaml numba llvmlite"


steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install HDF5 library
run: sudo apt-get install libhdf5-dev

- name: Install python dependencies
shell: bash
run: |
pip install --disable-pip-version-check --upgrade pip
pip install --upgrade wheel
pip install --no-build-isolation ${{ matrix.numpy }};
pip install --no-build-isolation pytest ${{ matrix.deps }};
pip list
- name: Run tests
shell: bash
continue-on-error: ${{ matrix.display_name == 'pre-releases' }}
run: |
pytest trackpy
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ doc/tutorial/*_files
.idea
doc/examples/index.rst
soft-matter-docs-deploy

# VS Code
.vscode
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@ language: python

jobs:
include:
# "Legacy" environments: oldest supported versions, without and with optional dependencies
- python: "3.5"
env: DEPS="numpy=1.13.1 scipy=0.19.1 matplotlib=2.0.2 pandas=0.20.3 pyyaml" BUILD_DOCS=true
- python: "3.5"
env: DEPS="numpy=1.13.1 scipy=0.19.1 matplotlib=2.0.2 pillow=4.2.1 pandas=0.20.3 scikit-image=0.13.0 pytables scikit-learn=0.19.0 pyyaml" BUILD_DOCS=true
# "Typical" environments: versions 2-3 years old
# Python 3, circa September 2017 (Anaconda 5.0.0)
# Python 3, circa September 2017 (Anaconda 5.0.0), used for building docs
- python: "3.5"
env: DEPS="numpy=1.13.1 scipy=0.19.1 matplotlib=2.0.2 pillow=4.2.1 pandas=0.20.3 scikit-image=0.13.0 pytables numba=0.35.0 scikit-learn=0.19.0 pyyaml" BUILD_DOCS=true
# Environments with most recent versions
- python: "3.7"
env: DEPS="numpy scipy!=1.5.0 matplotlib pillow pandas scikit-image pytables numba scikit-learn pyyaml pytables" BUILD_DOCS=false


install:
- conda update --yes conda
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
trackpy
=======

[![Build Status](https://travis-ci.org/soft-matter/trackpy.svg?branch=master)](https://travis-ci.org/soft-matter/trackpy)
[![Build status](https://ci.appveyor.com/api/projects/status/jsd62y3e4rlx3f9u/branch/master?svg=true)](https://ci.appveyor.com/project/caspervdw/trackpy-rixcv/branch/master)
[![Build status](https://github.com/soft-matter/trackpy/workflows/Linux/badge.svg)](https://github.com/soft-matter/trackpy/actions/)
[![Build status](https://github.com/soft-matter/trackpy/workflows/Conda/badge.svg)](https://github.com/soft-matter/trackpy/actions/)
[![DOI](https://zenodo.org/badge/4744355.svg)](https://zenodo.org/badge/latestdoi/4744355)

What is it?
Expand Down
30 changes: 0 additions & 30 deletions appveyor.yml

This file was deleted.

8 changes: 4 additions & 4 deletions benchmarks/maxima_benchmarks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ real_image = scale_to_gamut(tp.bandpass(real_image_raw, 1, 10, threshold=1), np.
big_image = scale_to_gamut(tp.bandpass(np.tile(real_image_raw, (2, 5)), 1, 10, threshold=1), np.uint8)
very_small_image = scale_to_gamut(tp.bandpass(real_image_raw[:200, :200], 1, 10, threshold=1), np.uint8)

#print 'Locate using Python Engine with Default Settings (Accurate)'
#print('Locate using Python Engine with Default Settings (Accurate)')
#b(u"timeit tp.locate(real_image, 9, engine='python', preprocess=False)")

print '1x: Find local_maxima only'
print('1x: Find local_maxima only')
b(u"timeit tp.feature.local_maxima(real_image, 9, 10)")

print '10x: Find local_maxima only'
print('10x: Find local_maxima only')
b(u"timeit tp.feature.local_maxima(big_image, 9, 10)")

print '~0.1x: Find local_maxima only'
print('~0.1x: Find local_maxima only')
b(u"timeit tp.feature.local_maxima(very_small_image, 9, 10)")
14 changes: 7 additions & 7 deletions benchmarks/numba_benchmarks.ipy
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ real_image_raw = tp.ImageSequence('../trackpy/tests/video/image_sequence')[0]
real_image = tp.bandpass(real_image_raw, 1, 10, threshold=1)
big_image = tp.bandpass(np.tile(real_image_raw, (2, 5)), 1, 10, threshold=1)

print 'Compiling Numba...'
print('Compiling Numba...')
tp.locate(dummy_noise_image, 9, engine='numba')

#print 'Locate using Python Engine with Default Settings (Accurate)'
#print('Locate using Python Engine with Default Settings (Accurate)')
#b(u"timeit tp.locate(real_image, 9, engine='python', preprocess=False)")

print '10x: Locate using Python Engine with Default Settings (Accurate)'
print('10x: Locate using Python Engine with Default Settings (Accurate)')
b("timeit tp.locate(big_image, 9, engine='python', preprocess=False)")

print '10x: Locate using Python Engine with Fast Settings (Sloppy)'
print('10x: Locate using Python Engine with Fast Settings (Sloppy)')
b("timeit tp.locate(big_image, 9, engine='python', preprocess=False, filter_before=False, filter_after=False, max_iterations=0, characterize=False)")

print '1x: Locate using Numba Engine with Default Settings (Accurate)'
print('1x: Locate using Numba Engine with Default Settings (Accurate)')
b("timeit tp.locate(real_image, 9, engine='numba', preprocess=False)")

print '10x: Locate using Numba Engine with Default Settings (Accurate)'
print('10x: Locate using Numba Engine with Default Settings (Accurate)')
b("timeit tp.locate(big_image, 9, engine='numba', preprocess=False)")

print '10x: Locate using Numba Engine with Fast Settings (Sloppy)'
print('10x: Locate using Numba Engine with Fast Settings (Sloppy)')
b("timeit tp.locate(big_image, 9, engine='numba', preprocess=False, filter_before=False, filter_after=False, max_iterations=0, characterize=False)")

10 changes: 5 additions & 5 deletions benchmarks/simple_benchmarks.ipy
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ dummy_noise_image = np.random.randint(0, 100, (100, 100))
real_image_raw = tp.ImageSequence('../trackpy/tests/video/image_sequence')[0]
real_image = tp.bandpass(real_image_raw, 1, 10, threshold=1)

print 'Compiling Numba...'
print('Compiling Numba...')
tp.locate(dummy_noise_image, 9, engine='numba')

print 'Locate using Python Engine with Default Settings (Accurate)'
print('Locate using Python Engine with Default Settings (Accurate)')
b("timeit tp.locate(real_image, 9, engine='python', preprocess=False)")

print 'Locate using Python Engine with Fast Settings (Sloppy)'
print('Locate using Python Engine with Fast Settings (Sloppy)')
b("timeit tp.locate(real_image, 9, engine='python', preprocess=False, filter_before=False, filter_after=False, max_iterations=0, characterize=False)")

print 'Locate using Numba Engine with Default Settings (Accurate)'
print('Locate using Numba Engine with Default Settings (Accurate)')
b("timeit tp.locate(real_image, 9, engine='numba', preprocess=False)")

print 'Locate using Numba Engine with Fast Settings (Sloppy)'
print('Locate using Numba Engine with Fast Settings (Sloppy)')
b("timeit tp.locate(real_image, 9, engine='numba', preprocess=False, filter_before=False, filter_after=False, max_iterations=0, characterize=False)")

6 changes: 3 additions & 3 deletions benchmarks/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def generate_rst_files(benchmarks):
fig_base_path = os.path.join(vb_path, 'figures')

if not os.path.exists(vb_path):
print 'creating %s' % vb_path
print('creating %s' % vb_path)
os.makedirs(vb_path)

if not os.path.exists(fig_base_path):
print 'creating %s' % fig_base_path
print('creating %s' % fig_base_path)
os.makedirs(fig_base_path)

for bmk in benchmarks:
print 'Generating rst file for %s' % bmk.name
print('Generating rst file for %s' % bmk.name)
rst_path = os.path.join(RST_BASE, 'vbench/%s.txt' % bmk.name)

fig_full_path = os.path.join(fig_base_path, '%s.png' % bmk.name)
Expand Down

0 comments on commit 1776898

Please sign in to comment.