Skip to content

Commit 2b1764c

Browse files
chaithyagrchaithyagrsfarrenspaquiteau
authored
Merge Develop for a new release (#322)
* Add support for tensorflow backend which allows for differentiability (#112) * Added support for tensorflow * Updates to get tests passing * Or --> And * Moving modopt to allow working with tensorflow * Fix issues with wos * Fix all flakes finally! * Update modopt/base/backend.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/base/backend.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Minute updates to codes * Add dynamic module * Fix docu * Fix PEP Co-authored-by: chaithyagr <chaithyagr@gitlab.com> Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Fix 115 (#116) * Fix issues * Add right tests * Fix PEP Co-authored-by: chaithyagr <chaithyagr@gitlab.com> * Minor bug fix, remove elif (#124) Co-authored-by: chaithyagr <chaithyagr@gitlab.com> * Add tests for modopt.base.backend and fix minute bug uncovered (#126) * Minor bug fix, remove elif * Add tests for backend * Fix tests * Add tests * Remove cupy * PEP fixes * Fix PEP * Fix PEP and update * Final PEP * Update setup.cfg Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update test_base.py Co-authored-by: chaithyagr <chaithyagr@gitlab.com> Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Release cleanup (#128) * updated GPU dependencies * added logo to manifest * updated package version and release date * Unpin package dependencies (#189) * unpinned dependencies * updated pinned documentation dependency versions * Add Gradient descent algorithms (#196) * Version 1.5.1 patch release (#114) * Add support for tensorflow backend which allows for differentiability (#112) * Added support for tensorflow * Updates to get tests passing * Or --> And * Moving modopt to allow working with tensorflow * Fix issues with wos * Fix all flakes finally! * Update modopt/base/backend.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/base/backend.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Minute updates to codes * Add dynamic module * Fix docu * Fix PEP Co-authored-by: chaithyagr <chaithyagr@gitlab.com> Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Fix 115 (#116) * Fix issues * Add right tests * Fix PEP Co-authored-by: chaithyagr <chaithyagr@gitlab.com> * Minor bug fix, remove elif (#124) Co-authored-by: chaithyagr <chaithyagr@gitlab.com> * Add tests for modopt.base.backend and fix minute bug uncovered (#126) * Minor bug fix, remove elif * Add tests for backend * Fix tests * Add tests * Remove cupy * PEP fixes * Fix PEP * Fix PEP and update * Final PEP * Update setup.cfg Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update test_base.py Co-authored-by: chaithyagr <chaithyagr@gitlab.com> Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Release cleanup (#128) * updated GPU dependencies * added logo to manifest * updated package version and release date Co-authored-by: Chaithya G R <chaithyagr@gmail.com> Co-authored-by: chaithyagr <chaithyagr@gitlab.com> * make algorithms a module. * add Gradient Descent Algorithms * enforce WPS compliance. * add test for gradient descent * Docstrings improvements * Add See Also and minor corrections * add idx initialisation for all algorithms. * fix merge error * fix typo Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> Co-authored-by: Chaithya G R <chaithyagr@gmail.com> Co-authored-by: chaithyagr <chaithyagr@gitlab.com> * Release cleanup (#198) * started clean up for next release * update progress * further clean up * additional clean up * cleaned up link to logo * fixed index.rst * fixed conflict * Fast Singular Value Thresholding (#209) * add SingularValueThreshold This Method provides 10x faster SVT estimation than the LowRankMatrix Operator. * linting * add test for fast computation. * flake8 compliance * Ignore DAR000 Error. * Update modopt/signal/svd.py tuples in docstring Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/signal/svd.py typo Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/opt/proximity.py typo Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * update docstring * fix isort * Update modopt/signal/svd.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/signal/svd.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * run isort Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * added writeable input data array feature for benchopt (#213) * removed flake8 limit * updated patch version * [lint] pydocstyle compliance. (#228) * [lint] pydocstyle compliance. * use pytest-pydocstyle * Power method: fix #211 (#212) * Correct the norm update for Power Method x_new should be divided by its norm, not by x_old_norm. * fix test value We are testing for eigen value of Identity. It should be one. * fix WPS350 * fix test value for unconverged case Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Switch from progressbar to tqdm (#231) * switch from progressbar to tqdm. The progress bar can be provided externally for nested usage. * exposes the progress bar argument. * Child classes better have to implement these. (my linter was complaining) * update docs for progress bar using tqdm. * fix WPS errors * drop progressbar requirement, add tqdm. * [lint] disable warning for non implemented function. * simplify progbar check and argument passthrough * Update README for tqdm dependency (#240) Remote progressbar, use tqdm. * add small help for the metric argument. (#241) * add small help for the metric argument. * RST validation * use single quote * use double backticks. Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * add implementation for admm and fast admm. Based on Goldstein2014 * add Goldstein ref. * WPS compliance. * Abstract class for cost function. * add custom cost operator for admm. * fix WPS compliance. * Ci update (#268) * update python version support. * use string for CI. * remove flake8 and wemake-python-styleguide This anticipates the change to black formatting. * remove wps checks * apparently conda does not support 3.11 for now * remove all linting testing. * fix np.int warning/error * fix dtype error * fix precision for doctest * added black and isort support * Update python version in README * add 3.7 for test back * don't test 3.10 twice * Test rewrite (#266) * add MatrixOperator. * move base test to pytest. * [fixme] remove flake8 and emoji config. * rewrite test_math module using pytest. * use fail/skipparam helper function. * generalize usage of failparam * refactor test_signal. * refactor test_signal, the end. * lint * fix missing parameter. * add dummy object test helper. * rewrite test for cost and gradients. * show missing lines in coverage reports * rewrite of proximity operators testing. * add fail low rank method. * add cases for algorithms test * add algorithm test. * add pytest-cases and pytest-xdists support. * add support for testing metrics. * improve base module coverage. * test for wrong mask in metric module. * add docstring. * update email adress and authors field. * 100% coverage for transform module. * move linear operator to class * update docstring. * paramet(e)rization. * update docstring. * improve test_helper module. * raises should be specified for each failparam call. * encapsulate module's test in classes. * skip test if sklearn is not installed. * pin pydocstyle * removed unnormalised Gaussian kernel option and corresponding test * Restrict scikit-image version for testing * added fix for basic test suite * set behaviour for different astropy versions * updated docstring for gaussian_kernel * Use example scripts as tests. (#277) * Initialize the example module. * do not export the assert statements. * add matplotlib as requirement. * add support for sphinx-gallery * Update modopt/examples/README.rst Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/examples/__init__.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/examples/conftest.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/examples/example_lasso_forward_backward.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * Update modopt/examples/example_lasso_forward_backward.py Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * ignore auto_example folder * doc formatting. * add pogm and basic comparison. * fix: add matplotlib for the plotting in examples scripts. * fix: add matplotlib for basic ci too. * ci: run pytest with xdist for faster testing --------- Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> * fix: specify data_range for ssim. Refs: #290 * typos. * feat(test): add test for admm. * feat(admm): improve doc. * refactor: rename abstract cost to CostParent. * feat: add test for fast admm. * feat(admm): improve docstrings. * style: remove extra line.c * feat: make POGM more memory efficient. * feat: add a dummy cost for the identity operator. * feat: create a linear operator module, add wavelet transform. * feat: add test case for wavelet transform. * Update setup.py --------- Co-authored-by: chaithyagr <chaithyagr@gitlab.com> Co-authored-by: Samuel Farrens <samuel.farrens@gmail.com> Co-authored-by: Pierre-Antoine Comby <77174042+paquiteau@users.noreply.github.com> Co-authored-by: Pierre-antoine Comby <pierre-antoine.comby@crans.org> Co-authored-by: Pierre-Antoine Comby <pierre-antoine.comby@ens-paris-saclay.fr>
1 parent 3bae0ac commit 2b1764c

39 files changed

Lines changed: 2439 additions & 2601 deletions

.github/workflows/cd-build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ jobs:
6262
- name: Set up Conda with Python 3.8
6363
uses: conda-incubator/setup-miniconda@v2
6464
with:
65-
auto-update-conda: true
66-
python-version: 3.8
67-
auto-activate-base: false
65+
python-version: "3.8"
6866

6967
- name: Install dependencies
7068
shell: bash -l {0}

.github/workflows/ci-build.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,12 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [ubuntu-latest, macos-latest]
19-
python-version: [3.8]
19+
python-version: ["3.10"]
2020

2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v2
2424

25-
- name: Report WPS Errors
26-
uses: wemake-services/wemake-python-styleguide@0.14.1
27-
continue-on-error: true
28-
with:
29-
reporter: 'github-pr-review'
30-
path: './modopt'
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
3425
- name: Set up Conda with Python ${{ matrix.python-version }}
3526
uses: conda-incubator/setup-miniconda@v2
3627
with:
@@ -52,7 +43,7 @@ jobs:
5243
python -m pip install --upgrade pip
5344
python -m pip install -r develop.txt
5445
python -m pip install -r docs/requirements.txt
55-
python -m pip install astropy scikit-image scikit-learn
46+
python -m pip install astropy "scikit-image<0.20" scikit-learn matplotlib
5647
python -m pip install tensorflow>=2.4.1
5748
python -m pip install twine
5849
python -m pip install .
@@ -61,7 +52,7 @@ jobs:
6152
shell: bash -l {0}
6253
run: |
6354
export PATH=/usr/share/miniconda/bin:$PATH
64-
python setup.py test
55+
pytest -n 2
6556
6657
- name: Save Test Results
6758
if: always()
@@ -98,7 +89,7 @@ jobs:
9889
fail-fast: false
9990
matrix:
10091
os: [ubuntu-latest, macos-latest]
101-
python-version: [3.6, 3.7, 3.9]
92+
python-version: ["3.7", "3.8", "3.9"]
10293

10394
steps:
10495
- name: Checkout
@@ -117,11 +108,11 @@ jobs:
117108
python --version
118109
python -m pip install --upgrade pip
119110
python -m pip install -r develop.txt
120-
python -m pip install astropy scikit-image scikit-learn
111+
python -m pip install astropy "scikit-image<0.20" scikit-learn matplotlib
121112
python -m pip install .
122113
123114
- name: Run Tests
124115
shell: bash -l {0}
125116
run: |
126117
export PATH=/usr/share/miniconda/bin:$PATH
127-
python setup.py test
118+
pytest -n 2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ instance/
7373
docs/_build/
7474
docs/source/fortuna.*
7575
docs/source/scripts.*
76+
docs/source/auto_examples/
7677
docs/source/*.nblink
7778

7879
# PyBuilder

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ All packages required by ModOpt should be installed automatically. Optional pack
3737
In order to run the code in this repository the following packages must be
3838
installed:
3939

40-
* [Python](https://www.python.org/) [> 3.6]
40+
* [Python](https://www.python.org/) [> 3.7]
4141
* [importlib_metadata](https://importlib-metadata.readthedocs.io/en/latest/) [==3.7.0]
4242
* [Numpy](http://www.numpy.org/) [==1.19.5]
4343
* [Scipy](http://www.scipy.org/) [==1.5.4]
44-
* [Progressbar 2](https://progressbar-2.readthedocs.io/) [==3.53.1]
44+
* [tqdm](https://tqdm.github.io/) [>=4.64.0]
4545

4646
### Optional Packages
4747

develop.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
coverage>=5.5
2-
flake8>=4
3-
nose>=1.3.7
42
pytest>=6.2.2
3+
pytest-raises>=0.10
4+
pytest-cases>= 3.6
5+
pytest-xdist>= 3.0.1
56
pytest-cov>=2.11.1
6-
pytest-pep8>=1.0.6
77
pytest-emoji>=0.2.0
8-
pytest-flake8>=1.0.7
9-
wemake-python-styleguide>=0.15.2
8+
pydocstyle==6.1.1
9+
pytest-pydocstyle>=2.2.0
10+
black
11+
isort
12+
pytest-black

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ numpydoc==1.1.0
66
sphinx==4.3.1
77
sphinxcontrib-bibtex==2.4.1
88
sphinxawesome-theme==3.2.1
9+
sphinx-gallery==0.11.1

docs/source/conf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
'nbsphinx',
4646
'nbsphinx_link',
4747
'numpydoc',
48+
"sphinx_gallery.gen_gallery"
4849
]
4950

5051
# Include module names for objects
@@ -145,6 +146,18 @@
145146
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
146147
html_show_copyright = True
147148

149+
150+
151+
# -- Options for Sphinx Gallery ----------------------------------------------
152+
153+
sphinx_gallery_conf = {
154+
"examples_dirs": ["../../modopt/examples/"],
155+
"filename_pattern": "/example_",
156+
"ignore_pattern": r"/(__init__|conftest)\.py",
157+
}
158+
159+
160+
148161
# -- Options for nbshpinx output ------------------------------------------
149162

150163

docs/source/refs.bib

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,15 @@ @article{zou2005
207207
journal = {Journal of the Royal Statistical Society Series B},
208208
doi = {10.1111/j.1467-9868.2005.00527.x}
209209
}
210+
211+
@article{Goldstein2014,
212+
author={Goldstein, Tom and O’Donoghue, Brendan and Setzer, Simon and Baraniuk, Richard},
213+
year={2014},
214+
month={Jan},
215+
pages={1588–1623},
216+
title={Fast Alternating Direction Optimization Methods},
217+
journal={SIAM Journal on Imaging Sciences},
218+
volume={7},
219+
ISSN={1936-4954},
220+
doi={10/gdwr49},
221+
}

docs/source/toc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
plugin_example
2727
notebooks
28+
auto_examples/index
2829

2930
.. toctree::
3031
:hidden:

modopt/examples/README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
========
2+
Examples
3+
========
4+
5+
This is a collection of Python scripts demonstrating the use of ModOpt.

0 commit comments

Comments
 (0)