Skip to content

Commit feabc1f

Browse files
authored
Merge branch 'main' into master
2 parents ffaf705 + 73982d2 commit feabc1f

File tree

15 files changed

+185
-70
lines changed

15 files changed

+185
-70
lines changed

.github/workflows/ci.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: build
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: 0 0 * * 0 # weekly
6+
pull_request:
7+
branches:
8+
- main
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
# based on https://slashgear.github.io/how-to-split-test-by-folder-with-github-action/
15+
get_notebooks:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
notebook: ${{ steps.get-notebooks.outputs.nb }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
- id: get-notebooks
22+
# it's weird to me, but the quotes around \n should *not* be escaped or it breaks
23+
run: "echo \"nb=$(ls TUTORIALS/*ipynb | jq -R -s -c 'split(\"\\n\")[:-1]')\"\
24+
\ >> $GITHUB_OUTPUT\n"
25+
notebooks:
26+
runs-on: ubuntu-latest
27+
needs: [get_notebooks]
28+
strategy:
29+
matrix:
30+
python-version: [3.7, 3.8, 3.9, '3.10']
31+
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
32+
fail-fast: false
33+
name: Execute notebooks
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: actions/setup-python@v4
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
cache: pip
40+
cache-dependency-path: setup.py
41+
- name: Setup FFmpeg
42+
uses: FedericoCarboni/setup-ffmpeg@v2
43+
- name: Install dependencies
44+
# nbclient 0.5.5 is the first version that includes jupyter execute
45+
run: |
46+
pip install --upgrade --upgrade-strategy eager .
47+
pip install jupyter ipywidgets
48+
pip install "nbclient>=0.5.5"
49+
- name: Run notebooks
50+
run: jupyter execute ${{ matrix.notebook }}.ipynb --kernel_name=python3
51+
tests:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
python-version: [3.7, 3.8, 3.9, '3.10']
56+
fail-fast: false
57+
name: Run tests
58+
steps:
59+
- uses: actions/checkout@v3
60+
- name: Install Python 3
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: ${{ matrix.python-version }}
64+
cache: pip
65+
cache-dependency-path: setup.py
66+
- name: Install dependencies
67+
run: |
68+
# using the --upgrade and --upgrade-strategy eager flags ensures that
69+
# pip will always install the latest allowed version of all
70+
# dependencies, to make sure the cache doesn't go stale
71+
pip install --upgrade --upgrade-strategy eager .
72+
pip install coverage
73+
- name: Run tests
74+
run: |
75+
# for some reason, need to run this in the TESTS dir in order to get
76+
# coverage to work (I couldn't get an analogous .coveragerc working in
77+
# the root directory)
78+
cd TESTS && coverage run unitTests.py
79+
# generate the xml file and move it to root dir for codecov
80+
coverage xml -o ../coverage.xml
81+
- name: Upload coverage to Codecov
82+
uses: codecov/codecov-action@858dd794fbb81941b6d60b0dca860878cba60fa9 # v3.1.1
83+
all_tutorials_in_docs:
84+
runs-on: ubuntu-latest
85+
name: Check that all tutorial notebooks are included in docs
86+
needs: [get_notebooks]
87+
strategy:
88+
matrix:
89+
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
90+
steps:
91+
- uses: actions/checkout@v3
92+
- name: Check for file
93+
shell: bash
94+
run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then
95+
exit 1; fi
96+
no_extra_nblinks:
97+
runs-on: ubuntu-latest
98+
name: Check that we don't have any extra nblink files
99+
steps:
100+
- uses: actions/checkout@v3
101+
- name: Check same number of nblink and notebooks
102+
shell: bash
103+
run: |
104+
n_nblink=0; for file in docs/tutorials/*nblink; do let "n_nblink+=1"; done;
105+
n_ipynb=0; for file in TUTORIALS/*ipynb; do let "n_ipynb+=1"; done;
106+
if [[ $n_nblink != $n_ipynb ]]; then exit 1; fi;
107+
108+
check:
109+
if: always()
110+
needs:
111+
- notebooks
112+
- tests
113+
runs-on: ubuntu-latest
114+
steps:
115+
- name: Decide whether all tests and notebooks succeeded
116+
uses: re-actors/alls-green@afee1c1eac2a506084c274e9c02c8e0687b48d9e # v1.2.2
117+
with:
118+
jobs: ${{ toJSON(needs) }}

.github/workflows/deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: deploy
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Python
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.x'
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install build
19+
- name: Build package
20+
run: python -m build --outdir dist/ --sdist
21+
- name: Publish package to test pypi
22+
uses: pypa/gh-action-pypi-publish@release/v1
23+
with:
24+
user: __token__
25+
password: ${{ secrets.PYPI_API_TOKEN }}

.readthedocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ formats: all
2020
conda:
2121
environment: docs/environment.yml
2222
python:
23-
version: 3.7
2423
install:
2524
- method: pip
2625
path: .

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# pyrtools: tools for multi-scale image processing
22

33
[![PyPI Version](https://img.shields.io/pypi/v/pyrtools.svg)](https://pypi.org/project/pyrtools/)
4-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LabForComputationalVision/pyrtools/blob/master/LICENSE)
5-
![Python version](https://img.shields.io/badge/python-3.5%7C3.6%7C3.7-blue.svg)
6-
[![Build Status](https://travis-ci.com/LabForComputationalVision/pyrtools.svg?branch=master)](https://travis-ci.com/LabForComputationalVision/pyrtools)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LabForComputationalVision/pyrtools/blob/main/LICENSE)
5+
![Python version](https://img.shields.io/badge/python-3.7|3.8|3.9|3.10-blue.svg)
6+
[![Build Status](https://github.com/LabForComputationalVision/pyrtools/workflows/build/badge.svg)](https://github.com/LabForComputationalVision/pyrtools/actions?query=workflow%3Abuild)
77
[![Documentation Status](https://readthedocs.org/projects/pyrtools/badge/?version=latest)](https://pyrtools.readthedocs.io/en/latest/?badge=latest)
88
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/LabForComputationalVision/pyrtools/v1.0.0?filepath=TUTORIALS%2F)
9-
[![codecov](https://codecov.io/gh/LabForComputationalVision/pyrtools/branch/master/graph/badge.svg?token=Ei9TYftdYi)](https://codecov.io/gh/LabForComputationalVision/pyrtools)
9+
[![codecov](https://codecov.io/gh/LabForComputationalVision/pyrtools/branch/main/graph/badge.svg?token=Ei9TYftdYi)](https://codecov.io/gh/LabForComputationalVision/pyrtools)
1010

1111
Briefly, the tools include:
1212
- Recursive multi-scale image decompositions (pyramids), including
@@ -24,6 +24,11 @@ does not attempt to recreate all of the matlab code from
2424
matlabPyrTools. The goal is to create a Python interface for the C
2525
code at the heart of matlabPyrTools.
2626

27+
**NOTE**: If you are only interested in the complex steerable pyramid, we have a
28+
pytorch implementation in the
29+
[plenoptic](https://github.com/LabForComputationalVision/plenoptic/) package;
30+
this implementation is differentiable.
31+
2732
# Installation
2833

2934
It's recommended you install from pip: `pip install pyrtools`. The pip
@@ -36,23 +41,15 @@ run the pip command, and then adding: `from Cython.Build import
3641
cythonize` and wrapping the `ext_modules` in the `setup` call with
3742
`cythonize`, but I'm not sure.
3843

39-
If you wish to install from the master branch, it's still recommended
44+
If you wish to install from the main branch, it's still recommended
4045
to use pip, just run `pip install .` (or `pip install -e .` if you
4146
want the changes you make in the directory to be reflected in your
4247
install) from the root directory of this project. The core of this
4348
code is the C code, and the pip install will compile it nicely.
4449

4550
## Dependencies
4651

47-
Python 3.5, 3.6, and 3.7 all officially supported.
48-
49-
Other requirements:
50-
- numpy
51-
- scipy
52-
- matplotlib
53-
- Pillow
54-
- tqdm
55-
- requests
52+
Dependencies are documented in `setup.py`.
5653

5754
IPython is optional. If it's not installed,
5855
`pyrtools.display_tools.animshow` must be called with `as_html5=False`
@@ -118,9 +115,7 @@ and Jupyter installed.
118115

119116
All code should be considered a beta release. By that we mean that it is being
120117
actively developed and tested. You can find unit tests in
121-
`TESTING/unitTests.py`.
122-
and run
123-
`python unitTests.py`.
118+
`TEST/unitTests.py` and run them with `python TEST/unitTests.py`.
124119

125120
If you're using functions or parameters that do not have associated unit
126121
tests you should test this yourself to make sure the results are correct.

.coveragerc renamed to TESTS/.coveragerc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[paths]
2+
source =
3+
../pyrtools
4+
*/site-packages/pyrtools
5+
16
[run]
27
branch = True
38
source = pyrtools
@@ -9,5 +14,3 @@ exclude_lines =
914
raise NotImplementedError
1015
if __name__ == .__main__.:
1116
ignore_errors = True
12-
omit =
13-
TESTS/*

docs/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- numpydoc
1010
- numpy
1111
- python
12-
- pip==9.0.3
12+
- pip
1313
- ipython
1414
- pip:
1515
- nbsphinx

docs/index.rst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
:target: https://pypi.org/project/pyrtools/
33

44
.. |license-shield| image:: https://img.shields.io/badge/license-MIT-yellow.svg
5-
:target: https://github.com/LabForComputationalVision/pyrtools/blob/master/LICENSE
5+
:target: https://github.com/LabForComputationalVision/pyrtools/blob/main/LICENSE
66

7-
.. |python-version-shield| image:: https://img.shields.io/badge/python-3.5%7C3.6%7C3.7-blue.svg
7+
.. |python-version-shield| image:: https://img.shields.io/badge/python-3.7%7C3.8%7C3.9%7C3.10-blue.svg
88

9-
.. |travis| image:: https://travis-ci.com/LabForComputationalVision/pyrtools.svg?branch=master
10-
:target: https://travis-ci.com/LabForComputationalVision/pyrtools
9+
.. |build| image:: https://github.com/LabForComputationalVision/pyrtools/workflows/build/badge.svg
10+
:target: https://github.com/LabForComputationalVision/pyrtools/actions?query=workflow%3Abuild
1111

1212
.. |binder| image:: https://mybinder.org/badge_logo.svg
1313
:target: https://mybinder.org/v2/gh/LabForComputationalVision/pyrtools/v1.0.0?filepath=TUTORIALS%2F
@@ -20,7 +20,7 @@
2020
pyrtools
2121
====================================
2222

23-
|pypi-shield| |license-shield| |python-version-shield| |travis| |binder|
23+
|pypi-shield| |license-shield| |python-version-shield| |build| |binder|
2424

2525
Pyrtools is a python package for multi-scale image processing, adapted
2626
from Eero Simoncelli's `matlabPyrTools
@@ -62,17 +62,12 @@ for image processing, here are some resources to get you started:
6262

6363
installation
6464
developerguide
65-
tutorial1
66-
tutorial2
67-
tutorial3
6865
api/modules
6966

7067
.. toctree::
7168
:maxdepth: 2
7269
:caption: Tutorials
70+
:glob:
7371
:numbered:
7472

75-
tutorials/tutorial1
76-
tutorials/tutorial2
77-
tutorials/tutorial3
78-
73+
tutorials/*

0 commit comments

Comments
 (0)