From 4bb596708b1cd240d60aea1bdca36fb36761a4b2 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 14:38:22 +0100 Subject: [PATCH 01/13] update python version support. --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 3ffcb6f4..3c429491 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.8] + python-version: [3.10] steps: - name: Checkout @@ -98,7 +98,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.6, 3.7, 3.9] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - name: Checkout From 2394c9e764bb2f9362da54234991baa53b717015 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 14:44:43 +0100 Subject: [PATCH 02/13] use string for CI. --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 3c429491..9715f6e7 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.10] + python-version: ["3.10"] steps: - name: Checkout @@ -98,7 +98,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - name: Checkout From 2be820387a43401c3c81032ddc84c8cd08adaf9f Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 15:46:13 +0100 Subject: [PATCH 03/13] remove flake8 and wemake-python-styleguide This anticipates the change to black formatting. --- develop.txt | 3 --- setup.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/develop.txt b/develop.txt index 7397e15c..18873188 100644 --- a/develop.txt +++ b/develop.txt @@ -1,10 +1,7 @@ coverage>=5.5 -flake8>=4 -nose>=1.3.7 pytest>=6.2.2 pytest-cov>=2.11.1 pytest-pep8>=1.0.6 pytest-emoji>=0.2.0 pytest-flake8>=1.0.7 -wemake-python-styleguide>=0.15.2 pytest-pydocstyle>=2.2.0 diff --git a/setup.py b/setup.py index c93dd020..c95e5984 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ license = 'MIT' # Set the package classifiers -python_versions_supported = ['3.6', '3.7', '3.8', '3.9'] +python_versions_supported = ['3.7', '3.8', '3.9', '3.10', '3.11'] os_platforms_supported = ['Unix', 'MacOS'] lc_str = 'License :: OSI Approved :: {0} License' From 3892b73da9c1868c38011b491bd45ff5cfc934f1 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 15:58:21 +0100 Subject: [PATCH 04/13] remove wps checks --- .github/workflows/ci-build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9715f6e7..47f90b56 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -22,14 +22,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Report WPS Errors - uses: wemake-services/wemake-python-styleguide@0.14.1 - continue-on-error: true - with: - reporter: 'github-pr-review' - path: './modopt' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Report WPS Errors + # uses: wemake-services/wemake-python-styleguide@0.14.1 + # continue-on-error: true + # with: + # reporter: 'github-pr-review' + # path: './modopt' + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up Conda with Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v2 From 75375fd4dc5c562d1eb53a800a1da0652f0ec81c Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 16:09:09 +0100 Subject: [PATCH 05/13] apparently conda does not support 3.11 for now --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 47f90b56..f79cd453 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -98,7 +98,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10"] steps: - name: Checkout From c0fbdd5d3cc361a59061f0c274a8f8fd262cffbc Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 16:17:13 +0100 Subject: [PATCH 06/13] remove all linting testing. --- develop.txt | 2 -- setup.cfg | 1 - 2 files changed, 3 deletions(-) diff --git a/develop.txt b/develop.txt index 18873188..e68efd79 100644 --- a/develop.txt +++ b/develop.txt @@ -1,7 +1,5 @@ coverage>=5.5 pytest>=6.2.2 pytest-cov>=2.11.1 -pytest-pep8>=1.0.6 pytest-emoji>=0.2.0 -pytest-flake8>=1.0.7 pytest-pydocstyle>=2.2.0 diff --git a/setup.cfg b/setup.cfg index 87496ced..afe46bbc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -84,7 +84,6 @@ testpaths = addopts = --verbose --emoji - --flake8 --cov=modopt --cov-report=term --cov-report=xml From c16a4712a988a3512d7a307d9704b65b41772a4b Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 17:05:49 +0100 Subject: [PATCH 07/13] fix np.int warning/error --- modopt/signal/svd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modopt/signal/svd.py b/modopt/signal/svd.py index 6dcb9eda..f3d40a51 100644 --- a/modopt/signal/svd.py +++ b/modopt/signal/svd.py @@ -57,7 +57,7 @@ def find_n_pc(u_vec, factor=0.5): ) # Get the shape of the array - array_shape = np.repeat(np.int(np.sqrt(u_vec.shape[0])), 2) + array_shape = np.repeat(int(np.sqrt(u_vec.shape[0])), 2) # Find the auto correlation of the left singular vector. u_auto = [ @@ -299,7 +299,7 @@ def svd_thresh_coef(input_data, operator, threshold, thresh_type='hard'): a_matrix = np.dot(s_values, v_vec) # Get the shape of the array - array_shape = np.repeat(np.int(np.sqrt(u_vec.shape[0])), 2) + array_shape = np.repeat(int(np.sqrt(u_vec.shape[0])), 2) # Compute threshold matrix. ti = np.array([ From 3e3f8d637e15dae385c7c115605f2179c9ff56fe Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 17:19:40 +0100 Subject: [PATCH 08/13] fix dtype error --- modopt/signal/positivity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modopt/signal/positivity.py b/modopt/signal/positivity.py index e4ec098d..c19ba62c 100644 --- a/modopt/signal/positivity.py +++ b/modopt/signal/positivity.py @@ -48,7 +48,7 @@ def pos_recursive(input_data): """ if input_data.dtype == 'O': - res = np.array([pos_recursive(elem) for elem in input_data]) + res = np.array([pos_recursive(elem) for elem in input_data], dtype="object") else: res = pos_thresh(input_data) From 0a2f1e94a8c2255a15dab7d6848d1cd882de457c Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 7 Dec 2022 18:11:44 +0100 Subject: [PATCH 09/13] fix precision for doctest --- modopt/signal/filter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modopt/signal/filter.py b/modopt/signal/filter.py index 8e24768c..84dd8160 100644 --- a/modopt/signal/filter.py +++ b/modopt/signal/filter.py @@ -73,8 +73,8 @@ def mex_hat(data_point, sigma): Examples -------- >>> from modopt.signal.filter import mex_hat - >>> mex_hat(2, 1) - -0.3521390522571337 + >>> round(mex_hat(2, 1), 15) + -0.352139052257134 """ data_point = check_float(data_point) @@ -108,8 +108,8 @@ def mex_hat_dir(data_gauss, data_mex, sigma): Examples -------- >>> from modopt.signal.filter import mex_hat_dir - >>> mex_hat_dir(1, 2, 1) - 0.17606952612856686 + >>> round(mex_hat_dir(1, 2, 1), 16) + 0.1760695261285668 """ data_gauss = check_float(data_gauss) From f7722e87c9db32e173ca7f6122bea295e0bd322f Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sat, 17 Dec 2022 17:17:48 +0100 Subject: [PATCH 10/13] added black and isort support --- develop.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/develop.txt b/develop.txt index e68efd79..25857153 100644 --- a/develop.txt +++ b/develop.txt @@ -3,3 +3,6 @@ pytest>=6.2.2 pytest-cov>=2.11.1 pytest-emoji>=0.2.0 pytest-pydocstyle>=2.2.0 +black +isort +pytest-black From 13f64c59c94e83dd6e9d894350cd3b1a36da5f28 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sat, 17 Dec 2022 17:18:07 +0100 Subject: [PATCH 11/13] Update python version in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91bebfc2..223d0b73 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@ All packages required by ModOpt should be installed automatically. Optional pack In order to run the code in this repository the following packages must be installed: -* [Python](https://www.python.org/) [> 3.6] +* [Python](https://www.python.org/) [> 3.7] * [importlib_metadata](https://importlib-metadata.readthedocs.io/en/latest/) [==3.7.0] * [Numpy](http://www.numpy.org/) [==1.19.5] * [Scipy](http://www.scipy.org/) [==1.5.4] -* [tqdm]([https://progressbar-2.readthedocs.io/](https://tqdm.github.io/) [>=4.64.0] +* [tqdm](https://tqdm.github.io/) [>=4.64.0] ### Optional Packages From a06b14e83c7f53556285257c01b0b4b17150388c Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sat, 17 Dec 2022 17:18:31 +0100 Subject: [PATCH 12/13] add 3.7 for test back --- .github/workflows/ci-build.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f79cd453..2132722c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -22,15 +22,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - # - name: Report WPS Errors - # uses: wemake-services/wemake-python-styleguide@0.14.1 - # continue-on-error: true - # with: - # reporter: 'github-pr-review' - # path: './modopt' - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Conda with Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v2 with: @@ -98,7 +89,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - name: Checkout From 51d0dfe015b7c0846c2919c1cf8c95a43cb96601 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Comby <77174042+paquiteau@users.noreply.github.com> Date: Mon, 2 Jan 2023 13:18:24 +0100 Subject: [PATCH 13/13] don't test 3.10 twice --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 2132722c..2279abef 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -89,7 +89,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9"] steps: - name: Checkout