From 957d4ee0bc744d6e216ad5ba7a985e6162329552 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 22 Sep 2023 17:59:34 +0200 Subject: [PATCH 01/51] fix: update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 344430b..4146bad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log ### All notable changes to `AMICO` will be documented in this file. -## `v2.0.0`
_2023-09-21_ +## `v2.0.1`
_2023-09-21_ ### 🛠️Changed - Bump `dmri-dicelib` to `v1.0.1` From 0577d93cbe04fd914df1f7f3c79a4b07f4cc766c Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 22 Sep 2023 18:04:00 +0200 Subject: [PATCH 02/51] ci: fix tasks trigger --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5d9646d..eee40eb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -24,7 +24,7 @@ compile_openblas_macos_arm64_task: build_macos_arm64_wheels_task: name: Build MacOS arm64 wheels alias: build_macos_arm64_wheels - only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE} + only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE} && (${CIRRUS_BRANCH} == 'master' || ${CIRRUS_BRANCH} =~ 'release/.*') macos_instance: image: ghcr.io/cirruslabs/macos-monterey-xcode:latest matrix: @@ -62,7 +62,7 @@ build_macos_arm64_wheels_task: trigger_github_workflow_task: name: Trigger GitHub workflow - only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE} + only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE} && (${CIRRUS_BRANCH} == 'master' || ${CIRRUS_BRANCH} =~ 'release/.*') depends_on: build_macos_arm64_wheels macos_instance: image: ghcr.io/cirruslabs/macos-monterey-xcode:latest From f7a96748656f7741454fb5aaaeb40168f9779d40 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 12:55:59 +0100 Subject: [PATCH 03/51] ci: bump OpenBLAS version --- .cirrus.yml | 8 ++++---- .github/workflows/build_wheels.yml | 4 ++-- .github/workflows/compile_openblas_linux.yml | 8 ++++---- .github/workflows/compile_openblas_macos_x86_64.yml | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5d9646d..572ca1e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,10 +11,10 @@ compile_openblas_macos_arm64_task: install_requirements_script: - brew install p7zip compile_openblas_arm64_script: - - curl -L -o OpenBLAS-0.3.21.tar.gz https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21.tar.gz - - tar -xzf OpenBLAS-0.3.21.tar.gz - - make -C OpenBLAS-0.3.21 TARGET=ARMV8 DYNAMIC_ARCH=1 - - make install -C OpenBLAS-0.3.21 PREFIX=${CIRRUS_WORKING_DIR}/OpenBLAS + - curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz + - tar -xzf OpenBLAS-0.3.25.tar.gz + - make -C OpenBLAS-0.3.25 TARGET=ARMV8 DYNAMIC_ARCH=1 + - make install -C OpenBLAS-0.3.25 PREFIX=${CIRRUS_WORKING_DIR}/OpenBLAS - 7z a OpenBLAS_macos_arm64.zip ./OpenBLAS/* - curl -X DELETE -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CIRRUS_BUILD_ID - curl -X POST -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables -d '{"name":"CIRRUS_BUILD_ID","value":"'"$CIRRUS_BUILD_ID"'"}' diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0ab7780..45bf030 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -21,8 +21,8 @@ jobs: - name: Download compiled OpenBLAS run: | - curl -L -o OpenBLAS-0.3.21.zip https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-${{ matrix.arch[2] }}.zip - 7z x OpenBLAS-0.3.21.zip -o"OpenBLAS" + curl -L -o OpenBLAS-0.3.25.zip https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.25-${{ matrix.arch[2] }}.zip + 7z x OpenBLAS-0.3.25.zip -o"OpenBLAS" - name: Set up the configuration file run: | diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index acb8c9b..006d2b5 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -19,12 +19,12 @@ jobs: - name: Compile OpenBLAS run: | - curl -L -o OpenBLAS-0.3.21.tar.gz https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21.tar.gz - tar -xzf OpenBLAS-0.3.21.tar.gz + curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz + tar -xzf OpenBLAS-0.3.25.tar.gz docker create --name=openblas_${{ matrix.arch[0] }} -i --volume=${GITHUB_WORKSPACE}:/host quay.io/pypa/${{ matrix.arch[1] }}:latest /bin/bash docker start openblas_${{ matrix.arch[0] }} - docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make -C /host/OpenBLAS-0.3.21 TARGET=${{ matrix.arch[2] }} DYNAMIC_ARCH=1" - docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make install -C /host/OpenBLAS-0.3.21 PREFIX=/host/OpenBLAS" + docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make -C /host/OpenBLAS-0.3.25 TARGET=${{ matrix.arch[2] }} DYNAMIC_ARCH=1" + docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make install -C /host/OpenBLAS-0.3.25 PREFIX=/host/OpenBLAS" - name: Upload artifacts uses: actions/upload-artifact@v3.1.3 diff --git a/.github/workflows/compile_openblas_macos_x86_64.yml b/.github/workflows/compile_openblas_macos_x86_64.yml index d2635da..f9c90a6 100644 --- a/.github/workflows/compile_openblas_macos_x86_64.yml +++ b/.github/workflows/compile_openblas_macos_x86_64.yml @@ -14,11 +14,11 @@ jobs: env: MACOSX_DEPLOYMENT_TARGET: "10.9" run: | - curl -L -o OpenBLAS-0.3.21.tar.gz https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21.tar.gz - tar -xzf OpenBLAS-0.3.21.tar.gz + curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz + tar -xzf OpenBLAS-0.3.25.tar.gz sudo ln -fs /usr/local/bin/gfortran-11 /usr/local/bin/gfortran - make -C OpenBLAS-0.3.21 TARGET=${{ matrix.arch[1] }} DYNAMIC_ARCH=1 - make install -C OpenBLAS-0.3.21 PREFIX=${GITHUB_WORKSPACE}/OpenBLAS + make -C OpenBLAS-0.3.25 TARGET=${{ matrix.arch[1] }} DYNAMIC_ARCH=1 + make install -C OpenBLAS-0.3.25 PREFIX=${GITHUB_WORKSPACE}/OpenBLAS - name: Upload artifacts uses: actions/upload-artifact@v3.1.3 From 66d06d94d89dfc192d45d34a8791924402b61998 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 13:10:34 +0100 Subject: [PATCH 04/51] ci: bump requirements version --- .cirrus.yml | 2 +- .github/workflows/build_wheels.yml | 18 +++++++-------- .github/workflows/publish_on_pypi.yml | 32 +++++++++++++-------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 572ca1e..92114c6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -48,7 +48,7 @@ build_macos_arm64_wheels_task: - brew install p7zip - brew install jq - brew install python@3.10 - - python3.10 -m pip install cibuildwheel==2.15.0 + - python3.10 -m pip install cibuildwheel==2.16.2 download_compiled_openblas_script: - CIRRUS_BUILD_ID=$(curl -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CIRRUS_BUILD_ID | jq -r .value) - curl -L -o OpenBLAS.zip https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID}/compile_openblas_macos_arm64/compiled_openblas/OpenBLAS_macos_arm64.zip diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 45bf030..a26a072 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -17,7 +17,7 @@ jobs: runs-on: windows-2019 steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - name: Download compiled OpenBLAS run: | @@ -29,7 +29,7 @@ jobs: python setup_site.py openblas libopenblas ${{ github.workspace }}\OpenBLAS\lib ${{ github.workspace }}\OpenBLAS\include - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.15.0 + uses: pypa/cibuildwheel@v2.16.2 env: CIBW_PLATFORM: windows CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} @@ -56,10 +56,10 @@ jobs: runs-on: macos-11 steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - name: Download compiled OpenBLAS - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: compile_openblas_macos_x86_64.yml workflow_conclusion: success @@ -73,7 +73,7 @@ jobs: python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.15.0 + uses: pypa/cibuildwheel@v2.16.2 env: MACOSX_DEPLOYMENT_TARGET: 10.9 CIBW_PLATFORM: macos @@ -110,10 +110,10 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - name: Download compiled OpenBLAS - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: compile_openblas_linux.yml workflow_conclusion: success @@ -132,7 +132,7 @@ jobs: platforms: ${{ matrix.arch[2] }} - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.15.0 + uses: pypa/cibuildwheel@v2.16.2 env: CIBW_PLATFORM: linux CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} @@ -152,7 +152,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - name: Set up the configuration file run: | diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index e2a58b4..79cea28 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -15,7 +15,7 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Download windows_AMD64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -25,7 +25,7 @@ jobs: search_artifacts: true - name: Download windows_x86 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -35,7 +35,7 @@ jobs: search_artifacts: true - name: Download macos_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -45,7 +45,7 @@ jobs: search_artifacts: true - name: Download macos_arm64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: macos_arm64_wheels.yml workflow_conclusion: success @@ -55,7 +55,7 @@ jobs: search_artifacts: true - name: Download linux_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -65,7 +65,7 @@ jobs: search_artifacts: true - name: Download linux_aarch64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -75,7 +75,7 @@ jobs: search_artifacts: true - name: Download source distribution - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -85,7 +85,7 @@ jobs: search_artifacts: true - name: Publish on PyPI - uses: pypa/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: skip-existing: true verbose: true @@ -102,7 +102,7 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Download windows_AMD64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -112,7 +112,7 @@ jobs: search_artifacts: true - name: Download windows_x86 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -122,7 +122,7 @@ jobs: search_artifacts: true - name: Download macos_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -132,7 +132,7 @@ jobs: search_artifacts: true - name: Download macos_arm64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: macos_arm64_wheels.yml workflow_conclusion: success @@ -142,7 +142,7 @@ jobs: search_artifacts: true - name: Download linux_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -152,7 +152,7 @@ jobs: search_artifacts: true - name: Download linux_aarch64 wheels - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -162,7 +162,7 @@ jobs: search_artifacts: true - name: Download source distribution - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v2.28.0 with: workflow: build_wheels.yml workflow_conclusion: success @@ -172,7 +172,7 @@ jobs: search_artifacts: true - name: Publish on PyPI Test - uses: pypa/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: repository_url: https://test.pypi.org/legacy/ skip-existing: true From 815021464593827347431597125623ba626aef7c Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 13:11:33 +0100 Subject: [PATCH 05/51] build: bump dmri-dicelib version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d88b63a..52c16f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,7 @@ install_requires = scipy>=1.5.4 dipy>=1.4.1 threadpoolctl>=3.1.0 - dmri-dicelib>=1.0.1 + dmri-dicelib>=1.0.3 importlib-metadata>=4.8.3; python_version<"3.8" python_requires = >=3.6 packages = From 07007db7f23162c67e8bfcb639ff60a230b2ed16 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 13:14:13 +0100 Subject: [PATCH 06/51] refactor: remove __future__ import --- amico/__init__.py | 2 -- amico/core.py | 2 -- amico/lut.pyx | 2 -- amico/models.pyx | 2 -- amico/preproc.py | 2 -- amico/scheme.py | 2 -- amico/util.py | 2 -- 7 files changed, 14 deletions(-) diff --git a/amico/__init__.py b/amico/__init__.py index 48bbbd1..1bc5e88 100755 --- a/amico/__init__.py +++ b/amico/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - from .core import Evaluation, setup from .util import set_verbose, get_verbose from . import core diff --git a/amico/core.py b/amico/core.py index 04c2673..3c0b39c 100644 --- a/amico/core.py +++ b/amico/core.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import time import glob diff --git a/amico/lut.pyx b/amico/lut.pyx index 6434826..c18020e 100644 --- a/amico/lut.pyx +++ b/amico/lut.pyx @@ -1,8 +1,6 @@ # distutils: language = c++ # cython: language_level = 3 -from __future__ import absolute_import, division, print_function - import numpy as np from os import makedirs import sys diff --git a/amico/models.pyx b/amico/models.pyx index 26712e0..a1597d2 100644 --- a/amico/models.pyx +++ b/amico/models.pyx @@ -1,8 +1,6 @@ # distutils: language = c++ # cython: language_level = 3 -from __future__ import absolute_import, division, print_function - import numpy as np from os import environ from os.path import join as pjoin diff --git a/amico/preproc.py b/amico/preproc.py index 74c9dbd..1f64762 100644 --- a/amico/preproc.py +++ b/amico/preproc.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import numpy as np from scipy.optimize import minimize import scipy.special diff --git a/amico/scheme.py b/amico/scheme.py index 36316f4..0833419 100644 --- a/amico/scheme.py +++ b/amico/scheme.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np from re import match as re_match from amico.util import LOG, NOTE, WARNING, ERROR diff --git a/amico/util.py b/amico/util.py index 944ad19..82e55ce 100644 --- a/amico/util.py +++ b/amico/util.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import os.path from sys import exit From 3b5215bd6c427b2e65dcde97181266c7d61bd329 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 13:55:22 +0100 Subject: [PATCH 07/51] refactor: replace relative imports --- amico/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/amico/__init__.py b/amico/__init__.py index 1bc5e88..5d853fa 100755 --- a/amico/__init__.py +++ b/amico/__init__.py @@ -1,10 +1,10 @@ -from .core import Evaluation, setup -from .util import set_verbose, get_verbose -from . import core -from . import scheme -from . import lut -from . import models -from . import util +from amico.core import Evaluation, setup +from amico.util import set_verbose, get_verbose +from amico import core +from amico import scheme +from amico import lut +from amico import models +from amico import util try: from importlib.metadata import version From 578edd77721b374ac0077e0ad998e56e289fe34e Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 14:05:32 +0100 Subject: [PATCH 08/51] refactor: remove unused imports --- amico/__init__.py | 12 +++++++----- amico/scheme.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/amico/__init__.py b/amico/__init__.py index 5d853fa..ff05358 100755 --- a/amico/__init__.py +++ b/amico/__init__.py @@ -1,10 +1,12 @@ from amico.core import Evaluation, setup from amico.util import set_verbose, get_verbose -from amico import core -from amico import scheme -from amico import lut -from amico import models -from amico import util +# from amico import core +# from amico import scheme +# from amico import lut +# from amico import models +# from amico import util + +__all__ = ['Evaluation', 'setup', 'set_verbose', 'get_verbose'] try: from importlib.metadata import version diff --git a/amico/scheme.py b/amico/scheme.py index 0833419..d2df420 100644 --- a/amico/scheme.py +++ b/amico/scheme.py @@ -1,6 +1,6 @@ import numpy as np from re import match as re_match -from amico.util import LOG, NOTE, WARNING, ERROR +from amico.util import ERROR from amico.synthesis import _GAMMA class Scheme : From 48e1d048b1503c435fbded2a863763ce169a4911 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Dec 2023 14:54:57 +0100 Subject: [PATCH 09/51] refactor: add noexcept modifier to nogil functions --- amico/models.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/amico/models.pyx b/amico/models.pyx index a1597d2..bd52cce 100644 --- a/amico/models.pyx +++ b/amico/models.pyx @@ -38,13 +38,13 @@ cdef void _init_multithread_progress(int nthreads): @cython.boundscheck(False) @cython.wraparound(False) -cdef void _update_multithread_progress(int thread_id) nogil: +cdef void _update_multithread_progress(int thread_id) noexcept nogil: global _MULTITHREAD_PROGRESS_VIEW _MULTITHREAD_PROGRESS_VIEW[thread_id] += 1 @cython.boundscheck(False) @cython.wraparound(False) -cdef void _compute_rmse(double [::1, :]A_view, double [::1]y_view, double [::1]x_view, double *y_est_view, double *rmse_view) nogil: +cdef void _compute_rmse(double [::1, :]A_view, double [::1]y_view, double [::1]x_view, double *y_est_view, double *rmse_view) noexcept nogil: cdef Py_ssize_t i, j for i in range(A_view.shape[0]): y_est_view[i] = 0.0 @@ -55,7 +55,7 @@ cdef void _compute_rmse(double [::1, :]A_view, double [::1]y_view, double [::1]x @cython.boundscheck(False) @cython.wraparound(False) -cdef void _compute_nrmse(double [::1, :]A_view, double [::1]y_view, double [::1]x_view, double *y_est_view, double *nrmse_view) nogil: +cdef void _compute_nrmse(double [::1, :]A_view, double [::1]y_view, double [::1]x_view, double *y_est_view, double *nrmse_view) noexcept nogil: cdef double den = 0.0 cdef Py_ssize_t i, j for i in range(A_view.shape[0]): From 3d6b6c2ea73485ac61fea69f2d071faf5fb0bda1 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 13 Dec 2023 16:53:03 +0100 Subject: [PATCH 10/51] build: bump version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 52c16f0..b89a989 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dmri-amico -version = 2.0.1 +version = 2.0.2 url = https://github.com/daducci/AMICO download_url = https://pypi.org/project/dmri-amico project_urls = From 0ec611ea3e0cb5003d63a4c812c5b1fc4f4ca128 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 13 Dec 2023 17:03:19 +0100 Subject: [PATCH 11/51] docs: fix license version --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bf230f3..2e43c8d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ################################################################################ AMICO software license agreement - Version 2.0.0, 24 July 2023 + Version 2, 24 July 2023 ################################################################################ ------------------------------------PREAMBLE------------------------------------ From 66a7a1304c92fdfe410d0facd61cb64832e08f4a Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 13 Dec 2023 17:55:18 +0100 Subject: [PATCH 12/51] ci: fix OpenBLAS download link --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index a26a072..d600e6d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -21,7 +21,7 @@ jobs: - name: Download compiled OpenBLAS run: | - curl -L -o OpenBLAS-0.3.25.zip https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.25-${{ matrix.arch[2] }}.zip + curl -L -o OpenBLAS-0.3.25.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-${{ matrix.arch[2] }}.zip 7z x OpenBLAS-0.3.25.zip -o"OpenBLAS" - name: Set up the configuration file From 2975eb55aef2707ffb3118c586961a332da4aa1e Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 15 Dec 2023 11:51:48 +0100 Subject: [PATCH 13/51] build: bump Cython version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a22bc99..37418f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools>=59.6.0", - "Cython>=3.0.2", + "Cython>=3.0.6", "spams-cython>=1.0.0" ] build-backend = "setuptools.build_meta" From 53a86705a8e8bc3fc6c372c9c5ee356634266274 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 10:51:38 +0100 Subject: [PATCH 14/51] ci: replace cirrus with gh action for macos arm64 --- .cirrus.yml | 75 ------------------- .github/workflows/build_wheels.yml | 30 ++++---- ..._x86_64.yml => compile_openblas_macos.yml} | 11 +-- 3 files changed, 20 insertions(+), 96 deletions(-) delete mode 100644 .cirrus.yml rename .github/workflows/{compile_openblas_macos_x86_64.yml => compile_openblas_macos.yml} (74%) diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index e63f701..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,75 +0,0 @@ -compile_openblas_macos_arm64_task: - name: Compile OpenBLAS on MacOS arm64 - alias: compile_openblas_macos_arm64 - trigger_type: manual - macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:latest - env: - MACOSX_DEPLOYMENT_TARGET: "11.0" - clone_script: - - echo SKIP CLONE - install_requirements_script: - - brew install p7zip - compile_openblas_arm64_script: - - curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz - - tar -xzf OpenBLAS-0.3.25.tar.gz - - make -C OpenBLAS-0.3.25 TARGET=ARMV8 DYNAMIC_ARCH=1 - - make install -C OpenBLAS-0.3.25 PREFIX=${CIRRUS_WORKING_DIR}/OpenBLAS - - 7z a OpenBLAS_macos_arm64.zip ./OpenBLAS/* - - curl -X DELETE -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CIRRUS_BUILD_ID - - curl -X POST -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables -d '{"name":"CIRRUS_BUILD_ID","value":"'"$CIRRUS_BUILD_ID"'"}' - compiled_openblas_artifacts: - path: 'OpenBLAS_macos_arm64.zip' - -build_macos_arm64_wheels_task: - name: Build MacOS arm64 wheels - alias: build_macos_arm64_wheels - only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE} && (${CIRRUS_BRANCH} == 'master' || ${CIRRUS_BRANCH} =~ 'release/.*') - macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:latest - matrix: - - env: - CP: "38" - - env: - CP: "39" - - env: - CP: "310" - - env: - CP: "311" - env: - MACOSX_DEPLOYMENT_TARGET: 11.0 - PATH: ${PATH}:/opt/homebrew/opt/python@3.10/bin - CIBW_PLATFORM: macos - CIBW_BUILD: cp${CP}-macosx_arm64 - CIBW_ARCHS_MACOS: arm64 - CIBW_REPAIR_WHEEL_COMMAND_MACOS: > - DYLD_LIBRARY_PATH=${CIRRUS_WORKING_DIR}/OpenBLAS/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} - install_requirements_script: - - brew install p7zip - - brew install jq - - brew install python@3.10 - - python3.10 -m pip install cibuildwheel==2.16.2 - download_compiled_openblas_script: - - CIRRUS_BUILD_ID=$(curl -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CIRRUS_BUILD_ID | jq -r .value) - - curl -L -o OpenBLAS.zip https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID}/compile_openblas_macos_arm64/compiled_openblas/OpenBLAS_macos_arm64.zip - - 7z x OpenBLAS.zip -o"OpenBLAS" - set_up_configuration_file_script: - - python3.10 setup_site.py openblas openblas ${CIRRUS_WORKING_DIR}/OpenBLAS/lib ${CIRRUS_WORKING_DIR}/OpenBLAS/include - run_cibuildwheel_script: - - cibuildwheel - wheels_macos_arm64_artifacts: - path: './wheelhouse/*.whl' - -trigger_github_workflow_task: - name: Trigger GitHub workflow - only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE} && (${CIRRUS_BRANCH} == 'master' || ${CIRRUS_BRANCH} =~ 'release/.*') - depends_on: build_macos_arm64_wheels - macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:latest - clone_script: - - echo SKIP CLONE - install_requirements_script: - - brew install jq - trigger_script: - - CHECK_ID_MACOS_ARM64=$(curl -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CHECK_ID_MACOS_ARM64 | jq -r .value) - - curl -X POST -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/workflows/macos_arm64_wheels.yml/dispatches -d '{"ref":"'"$CIRRUS_BRANCH"'","inputs":{"cirrus_build_id":"'"$CIRRUS_BUILD_ID"'","check_id_macos_arm64":"'"$CHECK_ID_MACOS_ARM64"'"}}' diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d600e6d..feb9a08 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -46,14 +46,22 @@ jobs: path: ./wheelhouse/*.whl if-no-files-found: error - build_macos_x86_64_wheels: + build_macos_wheels: strategy: matrix: - py: [cp36, cp37, cp38, cp39, cp310, cp311] + py: + - [cp38, cp39, cp310, cp311] arch: - - [x86_64, macosx_x86_64] + - [x86_64, macosx_x86_64, 10.9, macos-11] + - [arm64, macosx_arm64, 11.0, macos-14] + include: + - py: cp36 + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + - py: cp37 + arch: [x86_64, macosx_x86_64, 10.9, macos-11] name: ${{ matrix.py }}-${{ matrix.arch[1] }} - runs-on: macos-11 + runs-on: ${{ matrix.arch[3] }} + if: steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -61,7 +69,7 @@ jobs: - name: Download compiled OpenBLAS uses: dawidd6/action-download-artifact@v2.28.0 with: - workflow: compile_openblas_macos_x86_64.yml + workflow: compile_openblas_macos.yml workflow_conclusion: success commit: ${{github.event.pull_request.head.sha}} name: OpenBLAS_macos_${{ matrix.arch[0] }} @@ -75,7 +83,7 @@ jobs: - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} uses: pypa/cibuildwheel@v2.16.2 env: - MACOSX_DEPLOYMENT_TARGET: 10.9 + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch[2] }} CIBW_PLATFORM: macos CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} CIBW_ARCHS_MACOS: ${{ matrix.arch[0] }} @@ -89,16 +97,6 @@ jobs: path: ./wheelhouse/*.whl if-no-files-found: error - create_macos_arm64_check: - name: Create MacOS arm64 check - runs-on: ubuntu-20.04 - steps: - - name: Create check - run: | - curl -X DELETE -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${{ secrets.REPO_TOKEN }}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CHECK_ID_MACOS_ARM64 - CHECK_ID_MACOS_ARM64=$(curl -X POST -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${{ github.token }}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/check-runs -d '{"name":"cp*-macosx_arm64","status":"in_progress","head_sha":"'"${{ github.sha }}"'"}' | jq -r .id) - curl -X POST -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${{ secrets.REPO_TOKEN }}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables -d '{"name":"CHECK_ID_MACOS_ARM64","value":"'"$CHECK_ID_MACOS_ARM64"'"}' - build_linux_wheels: strategy: matrix: diff --git a/.github/workflows/compile_openblas_macos_x86_64.yml b/.github/workflows/compile_openblas_macos.yml similarity index 74% rename from .github/workflows/compile_openblas_macos_x86_64.yml rename to .github/workflows/compile_openblas_macos.yml index f9c90a6..1b0fba9 100644 --- a/.github/workflows/compile_openblas_macos_x86_64.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,18 +1,19 @@ -name: Compile OpenBLAS on MacOS x86_64 -run-name: Compile OpenBLAS on MacOS x86_64 - ${{ github.sha }} +name: Compile OpenBLAS on MacOS +run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} on: workflow_dispatch jobs: compile_openblas: strategy: matrix: arch: - - [x86_64, SANDYBRIDGE] + - [x86_64, SANDYBRIDGE, 10.9, macos-11] + - [arm64, ARMV8, 11.0, macos-14] name: ${{ matrix.arch[0] }} - runs-on: macos-11 + runs-on: ${{ matrix.arch[3] }} steps: - name: Compile OpenBLAS env: - MACOSX_DEPLOYMENT_TARGET: "10.9" + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch[2] }} run: | curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz tar -xzf OpenBLAS-0.3.25.tar.gz From c77b5ea89ab4e4a017e65cafa07154239483fd3f Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 11:02:45 +0100 Subject: [PATCH 15/51] ci: delete unused workflow --- .github/workflows/macos_arm64_wheels.yml | 40 ------------------------ .github/workflows/publish_on_pypi.yml | 4 +-- 2 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/macos_arm64_wheels.yml diff --git a/.github/workflows/macos_arm64_wheels.yml b/.github/workflows/macos_arm64_wheels.yml deleted file mode 100644 index c46470f..0000000 --- a/.github/workflows/macos_arm64_wheels.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: MacOS arm64 wheels -run-name: MacOS arm64 wheels - ${{ github.sha }} -on: - workflow_dispatch: - inputs: - cirrus_build_id: - description: Cirrus CI build ID - required: true - type: number - check_id_macos_arm64: - description: Check ID MacOS arm64 - required: true - type: number -jobs: - download_macos_arm64_wheels: - name: '*-macosx_arm64' - runs-on: ubuntu-20.04 - steps: - - name: Download wheels from Cirrus CI - run: | - echo "DOWNLOAD_RESPONSE=$(curl -L -o wheels_macos_arm64.zip -w '%{http_code}' https://api.cirrus-ci.com/v1/artifact/build/${{ inputs.cirrus_build_id }}/build_macos_arm64_wheels/wheels_macos_arm64.zip)" >> $GITHUB_ENV - 7z x wheels_macos_arm64.zip - - - name: Upload artifacts - id: upload_artifacts - uses: actions/upload-artifact@v3.1.3 - with: - name: wheels_macos_arm64 - path: ./wheelhouse/*.whl - if-no-files-found: error - - - name: Complete MacOS arm64 check - if: env.DOWNLOAD_RESPONSE == 200 && steps.upload_artifacts.conclusion == 'success' - run: | - curl -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/daducci/AMICO/check-runs/${{ inputs.check_id_macos_arm64 }} -d '{"name":"cp*-macosx_arm64","status":"completed","conclusion":"success"}' - - - name: Complete MacOS arm64 check - if: (failure() && steps.upload_artifacts.conclusion != 'success') || env.DOWNLOAD_RESPONSE != 200 - run: | - curl -X PATCH -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ github.token }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/daducci/AMICO/check-runs/${{ inputs.check_id_macos_arm64 }} -d '{"name":"cp*-macosx_arm64","status":"completed","conclusion":"failure"}' diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index 79cea28..fdd2f2c 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -47,7 +47,7 @@ jobs: - name: Download macos_arm64 wheels uses: dawidd6/action-download-artifact@v2.28.0 with: - workflow: macos_arm64_wheels.yml + workflow: build_wheels.yml workflow_conclusion: success commit: ${{github.event.pull_request.head.sha}} name: wheels_macos_arm64 @@ -134,7 +134,7 @@ jobs: - name: Download macos_arm64 wheels uses: dawidd6/action-download-artifact@v2.28.0 with: - workflow: macos_arm64_wheels.yml + workflow: build_wheels.yml workflow_conclusion: success commit: ${{github.event.pull_request.head.sha}} name: wheels_macos_arm64 From a8c1b44a6ddc90114047e726bc6f93887706158a Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 11:03:18 +0100 Subject: [PATCH 16/51] ci: fix macos matrix --- .github/workflows/build_wheels.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index feb9a08..8ff2afd 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -55,10 +55,8 @@ jobs: - [x86_64, macosx_x86_64, 10.9, macos-11] - [arm64, macosx_arm64, 11.0, macos-14] include: - - py: cp36 - arch: [x86_64, macosx_x86_64, 10.9, macos-11] - - py: cp37 - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + py: [cp36, cp37] name: ${{ matrix.py }}-${{ matrix.arch[1] }} runs-on: ${{ matrix.arch[3] }} if: From 2df691eab2b38b7a552e7a8226fb3c613511af97 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 11:29:51 +0100 Subject: [PATCH 17/51] ci: fix macos matrix --- .github/workflows/build_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8ff2afd..9711f16 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -49,13 +49,13 @@ jobs: build_macos_wheels: strategy: matrix: - py: - - [cp38, cp39, cp310, cp311] + py: [cp38, cp39, cp310, cp311] arch: - [x86_64, macosx_x86_64, 10.9, macos-11] - [arm64, macosx_arm64, 11.0, macos-14] include: - - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + - arch: + - [x86_64, macosx_x86_64, 10.9, macos-11] py: [cp36, cp37] name: ${{ matrix.py }}-${{ matrix.arch[1] }} runs-on: ${{ matrix.arch[3] }} From 86c2bf963546d90851c366f911a49ecd7f2d72c6 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 11:32:04 +0100 Subject: [PATCH 18/51] ci: fix macos matrix --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 9711f16..536c864 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -55,7 +55,7 @@ jobs: - [arm64, macosx_arm64, 11.0, macos-14] include: - arch: - - [x86_64, macosx_x86_64, 10.9, macos-11] + - [x86_64, macosx_x86_64, 10.9, macos-11] py: [cp36, cp37] name: ${{ matrix.py }}-${{ matrix.arch[1] }} runs-on: ${{ matrix.arch[3] }} From f32024c75584b6bb45afeb43066785dc41295a95 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 11:54:31 +0100 Subject: [PATCH 19/51] ci: fix macos matrix --- .github/workflows/build_wheels.yml | 67 +++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 536c864..8b9484f 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -49,16 +49,51 @@ jobs: build_macos_wheels: strategy: matrix: - py: [cp38, cp39, cp310, cp311] - arch: - - [x86_64, macosx_x86_64, 10.9, macos-11] - - [arm64, macosx_arm64, 11.0, macos-14] - include: - - arch: - - [x86_64, macosx_x86_64, 10.9, macos-11] - py: [cp36, cp37] - name: ${{ matrix.py }}-${{ matrix.arch[1] }} - runs-on: ${{ matrix.arch[3] }} + config: + [ + { + py: cp36, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, + { + py: cp37, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, + { + py: cp38, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, + { + py: cp39, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, + { + py: cp310, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, + { + py: cp311, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, + { + py: cp38, + arch: [arm64, macosx_arm64, 11.0, macos-14] + }, + { + py: cp39, + arch: [arm64, macosx_arm64, 11.0, macos-14] + }, + { + py: cp310, + arch: [arm64, macosx_arm64, 11.0, macos-14] + }, + { + py: cp311, + arch: [arm64, macosx_arm64, 11.0, macos-14] + } + ] + name: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} + runs-on: ${{ matrix.config.arch[3] }} if: steps: - name: Checkout @@ -70,7 +105,7 @@ jobs: workflow: compile_openblas_macos.yml workflow_conclusion: success commit: ${{github.event.pull_request.head.sha}} - name: OpenBLAS_macos_${{ matrix.arch[0] }} + name: OpenBLAS_macos_${{ matrix.config.arch[0] }} path: OpenBLAS search_artifacts: true @@ -78,20 +113,20 @@ jobs: run: | python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include - - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} + - name: Build wheel ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} uses: pypa/cibuildwheel@v2.16.2 env: - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch[2] }} + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} CIBW_PLATFORM: macos - CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} - CIBW_ARCHS_MACOS: ${{ matrix.arch[0] }} + CIBW_BUILD: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} + CIBW_ARCHS_MACOS: ${{ matrix.config.arch[0] }} CIBW_REPAIR_WHEEL_COMMAND_MACOS: > DYLD_LIBRARY_PATH=${{ github.workspace }}/OpenBLAS/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} - name: Upload artifacts uses: actions/upload-artifact@v3.1.3 with: - name: wheels_macos_${{ matrix.arch[0] }} + name: wheels_macos_${{ matrix.config.arch[0] }} path: ./wheelhouse/*.whl if-no-files-found: error From 97012af1dbad88543adee397c24a43159e995105 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 11:59:34 +0100 Subject: [PATCH 20/51] ci: test trigger new workflow --- .github/workflows/compile_openblas_macos.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 1b0fba9..45e5647 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,11 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: workflow_dispatch +# on: workflow_dispatch +# NOTE: just for testing +on: + push: + branches: + - 'release/**' jobs: compile_openblas: strategy: From 5a653457cbf8ea8a788be04b8b01e1a45974d7fc Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 16:20:26 +0100 Subject: [PATCH 21/51] ci: restore workflow_dispatch trigger --- .github/workflows/compile_openblas_macos.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 45e5647..1b0fba9 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,11 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -# on: workflow_dispatch -# NOTE: just for testing -on: - push: - branches: - - 'release/**' +on: workflow_dispatch jobs: compile_openblas: strategy: From 698260e4103e0cd73ba53f91c44a9207546f5291 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 16:37:37 +0100 Subject: [PATCH 22/51] ci: add missing requirements --- .github/workflows/build_wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8b9484f..6cf254d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -109,6 +109,11 @@ jobs: path: OpenBLAS search_artifacts: true + - name: Install requirements + run: | + brew install pipx + brew install python@3.11 + - name: Set up the configuration file run: | python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include From d1073f9bd2bf2a29d5ccc6ffac2ad087cfdcf8ac Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 16:43:49 +0100 Subject: [PATCH 23/51] ci: bump cibuildwheel version --- .github/workflows/build_wheels.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 6cf254d..1a053fe 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -29,7 +29,7 @@ jobs: python setup_site.py openblas libopenblas ${{ github.workspace }}\OpenBLAS\lib ${{ github.workspace }}\OpenBLAS\include - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.16.2 + uses: pypa/cibuildwheel@v2.17.0 env: CIBW_PLATFORM: windows CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} @@ -112,14 +112,13 @@ jobs: - name: Install requirements run: | brew install pipx - brew install python@3.11 - name: Set up the configuration file run: | python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include - name: Build wheel ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} - uses: pypa/cibuildwheel@v2.16.2 + uses: pypa/cibuildwheel@v2.17.0 env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} CIBW_PLATFORM: macos @@ -168,7 +167,7 @@ jobs: platforms: ${{ matrix.arch[2] }} - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.16.2 + uses: pypa/cibuildwheel@v2.17.0 env: CIBW_PLATFORM: linux CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} From c6edf9088f6d50fb7eab4f689ad090891535d28c Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Tue, 12 Mar 2024 16:48:21 +0100 Subject: [PATCH 24/51] ci: add pipx installation for arm64 --- .github/workflows/build_wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 1a053fe..fc55882 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -109,7 +109,8 @@ jobs: path: OpenBLAS search_artifacts: true - - name: Install requirements + - name: Install pipx # NOTE: required only for arm64 + if: startsWith(matrix.config.arch[0], 'arm64') run: | brew install pipx From ae8a13c45b1f1637feb752a8eaf3e8c0c0f67c92 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 13:50:34 +0200 Subject: [PATCH 25/51] ci: bump OpenBLAS to v0.3.27 --- .github/workflows/build_wheels.yml | 14 +++++++++++--- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/compile_openblas_macos.yml | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index fc55882..5c047ba 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -9,7 +9,7 @@ jobs: build_windows_wheels: strategy: matrix: - py: [cp36, cp37, cp38, cp39, cp310, cp311] + py: [cp36, cp37, cp38, cp39, cp310, cp311, cp312] arch: - [AMD64, win_amd64, x64] - [x86, win32, x86] @@ -21,7 +21,7 @@ jobs: - name: Download compiled OpenBLAS run: | - curl -L -o OpenBLAS-0.3.25.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-${{ matrix.arch[2] }}.zip + curl -L -o OpenBLAS-0.3.25.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27-${{ matrix.arch[2] }}.zip 7z x OpenBLAS-0.3.25.zip -o"OpenBLAS" - name: Set up the configuration file @@ -75,6 +75,10 @@ jobs: py: cp311, arch: [x86_64, macosx_x86_64, 10.9, macos-11] }, + { + py: cp312, + arch: [x86_64, macosx_x86_64, 10.9, macos-11] + }, { py: cp38, arch: [arm64, macosx_arm64, 11.0, macos-14] @@ -90,6 +94,10 @@ jobs: { py: cp311, arch: [arm64, macosx_arm64, 11.0, macos-14] + }, + { + py: cp312, + arch: [arm64, macosx_arm64, 11.0, macos-14] } ] name: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} @@ -138,7 +146,7 @@ jobs: build_linux_wheels: strategy: matrix: - py: [cp36, cp37, cp38, cp39, cp310, cp311] + py: [cp36, cp37, cp38, cp39, cp310, cp311, cp312] arch: - [x86_64, manylinux_x86_64, amd64] - [aarch64, manylinux_aarch64, arm64] diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index 006d2b5..a182ed4 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -19,7 +19,7 @@ jobs: - name: Compile OpenBLAS run: | - curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz + curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27.tar.gz tar -xzf OpenBLAS-0.3.25.tar.gz docker create --name=openblas_${{ matrix.arch[0] }} -i --volume=${GITHUB_WORKSPACE}:/host quay.io/pypa/${{ matrix.arch[1] }}:latest /bin/bash docker start openblas_${{ matrix.arch[0] }} diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 1b0fba9..1a4554d 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -15,7 +15,7 @@ jobs: env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch[2] }} run: | - curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25.tar.gz + curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27.tar.gz tar -xzf OpenBLAS-0.3.25.tar.gz sudo ln -fs /usr/local/bin/gfortran-11 /usr/local/bin/gfortran make -C OpenBLAS-0.3.25 TARGET=${{ matrix.arch[1] }} DYNAMIC_ARCH=1 From e716e4d7687b739a8d40a2354d1df38d23d83465 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:02:40 +0200 Subject: [PATCH 26/51] ci: bump all requirements to latest version --- .github/workflows/build_wheels.yml | 26 +++++++++--------- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/compile_openblas_macos.yml | 2 +- .github/workflows/publish_on_pypi.yml | 28 ++++++++++---------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 5c047ba..0d3c9cc 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -17,7 +17,7 @@ jobs: runs-on: windows-2019 steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: Download compiled OpenBLAS run: | @@ -29,7 +29,7 @@ jobs: python setup_site.py openblas libopenblas ${{ github.workspace }}\OpenBLAS\lib ${{ github.workspace }}\OpenBLAS\include - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.17.0 + uses: pypa/cibuildwheel@v2.19.1 env: CIBW_PLATFORM: windows CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} @@ -40,7 +40,7 @@ jobs: delvewheel repair --add-path ${{ github.workspace }}\OpenBLAS\bin -w {dest_dir} -v {wheel} - name: Upload artifacts - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: wheels_windows_${{ matrix.arch[0] }} path: ./wheelhouse/*.whl @@ -105,10 +105,10 @@ jobs: if: steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: Download compiled OpenBLAS - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: compile_openblas_macos.yml workflow_conclusion: success @@ -127,7 +127,7 @@ jobs: python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include - name: Build wheel ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} - uses: pypa/cibuildwheel@v2.17.0 + uses: pypa/cibuildwheel@v2.19.1 env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} CIBW_PLATFORM: macos @@ -137,7 +137,7 @@ jobs: DYLD_LIBRARY_PATH=${{ github.workspace }}/OpenBLAS/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} - name: Upload artifacts - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: wheels_macos_${{ matrix.config.arch[0] }} path: ./wheelhouse/*.whl @@ -154,10 +154,10 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: Download compiled OpenBLAS - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: compile_openblas_linux.yml workflow_conclusion: success @@ -176,7 +176,7 @@ jobs: platforms: ${{ matrix.arch[2] }} - name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} - uses: pypa/cibuildwheel@v2.17.0 + uses: pypa/cibuildwheel@v2.19.1 env: CIBW_PLATFORM: linux CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} @@ -185,7 +185,7 @@ jobs: LD_LIBRARY_PATH=/host${{ github.workspace }}/OpenBLAS/lib auditwheel repair -w {dest_dir} {wheel} - name: Upload artifacts - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: wheels_linux_${{ matrix.arch[0] }} path: ./wheelhouse/*.whl @@ -196,7 +196,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: Set up the configuration file run: | @@ -209,7 +209,7 @@ jobs: python -m build --sdist - name: Upload artifacts - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: sdist path: ./dist/*.tar.gz diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index a182ed4..3aba37a 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -27,7 +27,7 @@ jobs: docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make install -C /host/OpenBLAS-0.3.25 PREFIX=/host/OpenBLAS" - name: Upload artifacts - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: OpenBLAS_linux_${{ matrix.arch[0] }} path: ./OpenBLAS diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 1a4554d..2a4b255 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -22,7 +22,7 @@ jobs: make install -C OpenBLAS-0.3.25 PREFIX=${GITHUB_WORKSPACE}/OpenBLAS - name: Upload artifacts - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: OpenBLAS_macos_${{ matrix.arch[0] }} path: ./OpenBLAS diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index fdd2f2c..08836b0 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -15,7 +15,7 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Download windows_AMD64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -25,7 +25,7 @@ jobs: search_artifacts: true - name: Download windows_x86 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -35,7 +35,7 @@ jobs: search_artifacts: true - name: Download macos_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -45,7 +45,7 @@ jobs: search_artifacts: true - name: Download macos_arm64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -55,7 +55,7 @@ jobs: search_artifacts: true - name: Download linux_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -65,7 +65,7 @@ jobs: search_artifacts: true - name: Download linux_aarch64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -75,7 +75,7 @@ jobs: search_artifacts: true - name: Download source distribution - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -102,7 +102,7 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Download windows_AMD64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -112,7 +112,7 @@ jobs: search_artifacts: true - name: Download windows_x86 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -122,7 +122,7 @@ jobs: search_artifacts: true - name: Download macos_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -132,7 +132,7 @@ jobs: search_artifacts: true - name: Download macos_arm64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -142,7 +142,7 @@ jobs: search_artifacts: true - name: Download linux_x86_64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -152,7 +152,7 @@ jobs: search_artifacts: true - name: Download linux_aarch64 wheels - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success @@ -162,7 +162,7 @@ jobs: search_artifacts: true - name: Download source distribution - uses: dawidd6/action-download-artifact@v2.28.0 + uses: dawidd6/action-download-artifact@v6 with: workflow: build_wheels.yml workflow_conclusion: success From f070c23dac591671b949b834b97f4842252e0c9b Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:03:43 +0200 Subject: [PATCH 27/51] chore: add default prams values to set() methods --- amico/models.pyx | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/amico/models.pyx b/amico/models.pyx index bd52cce..b51d952 100644 --- a/amico/models.pyx +++ b/amico/models.pyx @@ -248,7 +248,14 @@ class StickZeppelinBall( BaseModel ) : self.d_isos = np.array([ 3.0E-3 ]) # Isotropic diffusivitie(s) [mm^2/s] - def set( self, d_par, d_perps_zep, d_isos, d_par_zep=None, d_perp=0 ) : + def set( + self, + d_par=1.7E-3, + d_perps_zep=np.array([1.19E-3, 0.85E-3, 0.51E-3, 0.17E-3]), + d_isos=np.array([3.0E-3]), + d_par_zep=1.7E-3, + d_perp=0 + ): self.d_par = d_par self.d_perp = d_perp if d_par_zep is None: @@ -384,7 +391,13 @@ class CylinderZeppelinBall( BaseModel ) : self.isExvivo = False # Add dot compartment to dictionary (exvivo data) - def set( self, d_par, Rs, d_perps, d_isos ) : + def set( + self, + d_par=0.6E-3, + Rs=np.concatenate(([0.01], np.linspace(0.5, 8.0, 20))) * 1E-6, + d_perps=np.array([1.19E-3, 0.85E-3, 0.51E-3, 0.17E-3]), + d_isos=np.array([2.0E-3]) + ): self.d_par = d_par self.Rs = np.array(Rs) self.d_perps = np.array(d_perps) @@ -644,11 +657,18 @@ class NODDI( BaseModel ) : self.isExvivo = False - def set( self, dPar, dIso, IC_VFs, IC_ODs, isExvivo ): + def set( + self, + dPar=1.7E-33, + dIso=3.0E-3, + IC_VFs=np.linspace(0.1, 0.99, 12), + IC_ODs=np.hstack((np.array([0.03, 0.06]), np.linspace(0.09, 0.99, 10))), + isExvivo=False + ): self.dPar = dPar self.dIso = dIso - self.IC_VFs = np.array( IC_VFs ) - self.IC_ODs = np.array( IC_ODs ) + self.IC_VFs = np.array( IC_VFs ) if isinstance(IC_VFs, list) else IC_VFs + self.IC_ODs = np.array( IC_ODs ) if isinstance(IC_ODs, list) else IC_ODs self.isExvivo = isExvivo if isExvivo: self.maps_name.append('dot') @@ -969,7 +989,13 @@ class FreeWater( BaseModel ) : self.d_isos = [ 2.5E-3 ] # Isotropic diffusivities [mm^2/s] - def set( self, d_par, d_perps, d_isos, type ) : + def set( + self, + d_par=1.0E-3, + d_perps=np.linspace(0.1, 1.0, 10) * 1E-3, + d_isos=np.array([2.5E-3]), + type='Human' + ): self.d_par = d_par self.d_perps = d_perps self.d_isos = d_isos @@ -1296,7 +1322,13 @@ class SANDI( BaseModel ) : self.d_isos = np.linspace(0.25,3.0,5) * 1E-3 # Extra-cellular isotropic mean diffusivitie(s) [mm^2/s] - def set( self, d_is, Rs, d_in, d_isos ) : + def set( + self, + d_is=3.0E-3, + Rs=np.linspace(1.0, 12.0, 5) * 1E-6, + d_in=np.linspace(0.25, 3.0, 5) * 1E-3, + d_isos=np.linspace(0.25, 3.0, 5) * 1E-3 + ): self.d_is = d_is self.Rs = np.array(Rs) self.d_in = np.array(d_in) From 9994f1ec3b3e5222b508fb830fda4b7e3c240c2a Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:04:07 +0200 Subject: [PATCH 28/51] build: force to numpy <2.0.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b89a989..0a78da1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,7 +34,7 @@ keywords = [options] zip_safe = False install_requires = - numpy>=1.19.5 + numpy>=1.19.5, <2.0.0 scipy>=1.5.4 dipy>=1.4.1 threadpoolctl>=3.1.0 From ddf73c6e825ab782c3a15273d5e1ed953fe0f1dc Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:04:36 +0200 Subject: [PATCH 29/51] docs: fix link to installation guide in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbbf3ec..ebe212b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ### Implementation of the linear framework for Accelerated Microstructure Imaging via Convex Optimization (AMICO) described in [Daducci, Alessandro, et al. 2015](https://doi.org/10.1016/j.neuroimage.2014.10.026) ## Documentation -The documentation, including the [installation guide](https://github.com/daducci/AMICO/wiki/installation) as well as a series of demos/tutorials to show how to use AMICO to fit different models to your data, can be found in the [wiki](https://github.com/daducci/AMICO/wiki). +The documentation, including the [installation guide](https://github.com/daducci/AMICO/wiki/How-to-install-AMICO) as well as a series of demos/tutorials to show how to use AMICO to fit different models to your data, can be found in the [wiki](https://github.com/daducci/AMICO/wiki). ## Support For questions, requesting assistance, suggesting enhancements or new ideas as well as for reporting bugs, please [open an issue](https://github.com/daducci/AMICO/issues). From eae48ce2825502698c3bc5d87923438fcf717031 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:04:46 +0200 Subject: [PATCH 30/51] docs: update CHANGELOG.md --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4146bad..01e8f39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ # Change Log ### All notable changes to `AMICO` will be documented in this file. +## `v2.0.2`
_2024-07-01_ +### ✨Added +- Added `cp312` wheels to github actions + +### 🛠️Changed +- Restict the `numpy` version to `<2.0.0` (due to `dipy` problems) +- Parameters in the `set()` method of the models have now default values +- `MacOS arm64` wheels are now compiled with GitHub Actions instead of Cirrus CI + +### 🐛Fixed +- Link to installation guide in `README.md` +- Improved `print()` statements when running from `Jupyter notebooks` + +--- +--- + ## `v2.0.1`
_2023-09-21_ ### 🛠️Changed - Bump `dmri-dicelib` to `v1.0.1` From 81f27dcfdc27a7e0d7a8d17e67b1b8373fcf73d0 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:10:33 +0200 Subject: [PATCH 31/51] chore: flush print statements for better output on Jupyter --- amico/util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/amico/util.py b/amico/util.py index 82e55ce..b815707 100644 --- a/amico/util.py +++ b/amico/util.py @@ -25,23 +25,23 @@ def get_verbose(): def PRINT( *args, **kwargs ): if __VERBOSE_LEVEL__ >= 2: - print( *args, **kwargs ) + print( *args, **kwargs, flush=True ) def LOG( msg, prefix='' ): if __VERBOSE_LEVEL__ >= 2: - print( prefix+"\033[0;32m%s\033[0m" % msg ) + print( prefix+"\033[0;32m%s\033[0m" % msg, flush=True ) def NOTE( msg, prefix='' ): if __VERBOSE_LEVEL__ == 2: - print( prefix+"\033[0;30;44m[ NOTE ]\033[0;34m %s\033[0m" % msg ) + print( prefix+"\033[0;30;44m[ NOTE ]\033[0;34m %s\033[0m" % msg, flush=True ) def WARNING( msg, prefix='' ): if __VERBOSE_LEVEL__ >= 1: - print( prefix+"\033[0;30;43m[ WARNING ]\033[0;33m %s\033[0m" % msg ) + print( prefix+"\033[0;30;43m[ WARNING ]\033[0;33m %s\033[0m" % msg, flush=True ) def ERROR( msg, prefix='' ): if __VERBOSE_LEVEL__ >= 1: - print( prefix+"\033[0;30;41m[ ERROR ]\033[0;31m %s\033[0m\n" % msg ) + print( prefix+"\033[0;30;41m[ ERROR ]\033[0;31m %s\033[0m\n" % msg, flush=True ) try: from os import EX_USAGE # Only available on UNIX systems exit(EX_USAGE) From 6682d5fd5576da92984a5f71d54ab76e594eceea Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:12:04 +0200 Subject: [PATCH 32/51] ci: fix OpenBLAS version in all occurrences --- .github/workflows/build_wheels.yml | 4 ++-- .github/workflows/compile_openblas_linux.yml | 8 ++++---- .github/workflows/compile_openblas_macos.yml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0d3c9cc..c3c955b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -21,8 +21,8 @@ jobs: - name: Download compiled OpenBLAS run: | - curl -L -o OpenBLAS-0.3.25.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27-${{ matrix.arch[2] }}.zip - 7z x OpenBLAS-0.3.25.zip -o"OpenBLAS" + curl -L -o OpenBLAS-0.3.27.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27-${{ matrix.arch[2] }}.zip + 7z x OpenBLAS-0.3.27.zip -o"OpenBLAS" - name: Set up the configuration file run: | diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index 3aba37a..eb18368 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -19,12 +19,12 @@ jobs: - name: Compile OpenBLAS run: | - curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27.tar.gz - tar -xzf OpenBLAS-0.3.25.tar.gz + curl -L -o OpenBLAS-0.3.27.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27.tar.gz + tar -xzf OpenBLAS-0.3.27.tar.gz docker create --name=openblas_${{ matrix.arch[0] }} -i --volume=${GITHUB_WORKSPACE}:/host quay.io/pypa/${{ matrix.arch[1] }}:latest /bin/bash docker start openblas_${{ matrix.arch[0] }} - docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make -C /host/OpenBLAS-0.3.25 TARGET=${{ matrix.arch[2] }} DYNAMIC_ARCH=1" - docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make install -C /host/OpenBLAS-0.3.25 PREFIX=/host/OpenBLAS" + docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make -C /host/OpenBLAS-0.3.27 TARGET=${{ matrix.arch[2] }} DYNAMIC_ARCH=1" + docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make install -C /host/OpenBLAS-0.3.27 PREFIX=/host/OpenBLAS" - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 2a4b255..d56a840 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -15,11 +15,11 @@ jobs: env: MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch[2] }} run: | - curl -L -o OpenBLAS-0.3.25.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27.tar.gz - tar -xzf OpenBLAS-0.3.25.tar.gz + curl -L -o OpenBLAS-0.3.27.tar.gz https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27.tar.gz + tar -xzf OpenBLAS-0.3.27.tar.gz sudo ln -fs /usr/local/bin/gfortran-11 /usr/local/bin/gfortran - make -C OpenBLAS-0.3.25 TARGET=${{ matrix.arch[1] }} DYNAMIC_ARCH=1 - make install -C OpenBLAS-0.3.25 PREFIX=${GITHUB_WORKSPACE}/OpenBLAS + make -C OpenBLAS-0.3.27 TARGET=${{ matrix.arch[1] }} DYNAMIC_ARCH=1 + make install -C OpenBLAS-0.3.27 PREFIX=${GITHUB_WORKSPACE}/OpenBLAS - name: Upload artifacts uses: actions/upload-artifact@v4 From 7d582182d6df3774ccd6ffd137b51a30f498243a Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:13:51 +0200 Subject: [PATCH 33/51] ci: temp trigger OpenBLAS compilation on push --- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/compile_openblas_macos.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index eb18368..51ddee2 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on Linux run-name: Compile OpenBLAS on Linux - ${{ github.sha }} -on: workflow_dispatch +on: push jobs: compile_openblas: strategy: diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index d56a840..db123de 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: workflow_dispatch +on: push jobs: compile_openblas: strategy: From 1f8ddfa1e82c7c925fd754b68acbed97cd5129af Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 14:14:12 +0200 Subject: [PATCH 34/51] Revert "ci: temp trigger OpenBLAS compilation on push" This reverts commit 7d582182d6df3774ccd6ffd137b51a30f498243a. --- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/compile_openblas_macos.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index 51ddee2..eb18368 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on Linux run-name: Compile OpenBLAS on Linux - ${{ github.sha }} -on: push +on: workflow_dispatch jobs: compile_openblas: strategy: diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index db123de..d56a840 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: push +on: workflow_dispatch jobs: compile_openblas: strategy: From 23cd1597236c6ed7ea66db5b31cba026da760072 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 21:44:27 +0200 Subject: [PATCH 35/51] ci: fix artifacts name --- .github/workflows/build_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index c3c955b..57d368b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -42,7 +42,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: wheels_windows_${{ matrix.arch[0] }} + name: wheels_${{ matrix.arch[1] }}_${{ matrix.py }} path: ./wheelhouse/*.whl if-no-files-found: error @@ -139,7 +139,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: wheels_macos_${{ matrix.config.arch[0] }} + name: wheels_macos_${{ matrix.config.arch[1] }}_${{ matrix.config.py }} path: ./wheelhouse/*.whl if-no-files-found: error @@ -187,7 +187,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: wheels_linux_${{ matrix.arch[0] }} + name: wheels_linux_${{ matrix.arch[1] }}_${{ matrix.py }} path: ./wheelhouse/*.whl if-no-files-found: error From 4331f3b6b71bc74c6fe3d5b557f0b8385b01541d Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 28 Jun 2024 22:57:25 +0200 Subject: [PATCH 36/51] ci: update macos x86_64 runners --- .github/workflows/build_wheels.yml | 14 +++++++------- .github/workflows/compile_openblas_macos.yml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 57d368b..d57fb25 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -53,31 +53,31 @@ jobs: [ { py: cp36, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp37, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp38, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp39, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp310, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp311, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp312, - arch: [x86_64, macosx_x86_64, 10.9, macos-11] + arch: [x86_64, macosx_x86_64, 10.9, macos-12] }, { py: cp38, diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index d56a840..1a235c2 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: arch: - - [x86_64, SANDYBRIDGE, 10.9, macos-11] + - [x86_64, SANDYBRIDGE, 10.9, macos-12] - [arm64, ARMV8, 11.0, macos-14] name: ${{ matrix.arch[0] }} runs-on: ${{ matrix.arch[3] }} From 5684b3f3c1ff5ba6cd32b4ecd9d932a4871aaeec Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Sat, 29 Jun 2024 00:47:31 +0200 Subject: [PATCH 37/51] ci: temp trigger macos OpenBLAS compilation on push --- .github/workflows/compile_openblas_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 1a235c2..a8a146a 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: workflow_dispatch +on: push jobs: compile_openblas: strategy: From 18161dfc3b16aa30a9edb795ca14d9bd2c7f6734 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Sat, 29 Jun 2024 00:48:41 +0200 Subject: [PATCH 38/51] Revert "ci: temp trigger macos OpenBLAS compilation on push" This reverts commit 5684b3f3c1ff5ba6cd32b4ecd9d932a4871aaeec. --- .github/workflows/compile_openblas_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index a8a146a..1a235c2 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: push +on: workflow_dispatch jobs: compile_openblas: strategy: From b5d0b39542457aff04b91b08ee2f747dab3c1a53 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Sat, 29 Jun 2024 11:02:30 +0200 Subject: [PATCH 39/51] ci: test reinstall gcc to satisfy MacOS 10.9 --- .github/workflows/build_wheels.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d57fb25..1d9135b 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -122,6 +122,13 @@ jobs: run: | brew install pipx + - name: Reinstall gfortran to satisfy MacOS version requirements # NOTE: required only for x86_64 + if: startsWith(matrix.config.arch[0], 'x86_64') + env: + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} + run: | + brew reinstall gcc@11 + - name: Set up the configuration file run: | python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include From c453fbfbeafb04c281e36bfdcaa85eaa5eb772db Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Sat, 29 Jun 2024 11:12:48 +0200 Subject: [PATCH 40/51] ci: update macos deployment target to 12.0 --- .github/workflows/build_wheels.yml | 31 ++++++++------------ .github/workflows/compile_openblas_macos.yml | 6 ++-- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 1d9135b..bb6c55f 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -53,51 +53,51 @@ jobs: [ { py: cp36, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp37, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp38, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp39, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp310, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp311, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp312, - arch: [x86_64, macosx_x86_64, 10.9, macos-12] + arch: [x86_64, macosx_x86_64, 12.0, macos-12] }, { py: cp38, - arch: [arm64, macosx_arm64, 11.0, macos-14] + arch: [arm64, macosx_arm64, 12.0, macos-14] }, { py: cp39, - arch: [arm64, macosx_arm64, 11.0, macos-14] + arch: [arm64, macosx_arm64, 12.0, macos-14] }, { py: cp310, - arch: [arm64, macosx_arm64, 11.0, macos-14] + arch: [arm64, macosx_arm64, 12.0, macos-14] }, { py: cp311, - arch: [arm64, macosx_arm64, 11.0, macos-14] + arch: [arm64, macosx_arm64, 12.0, macos-14] }, { py: cp312, - arch: [arm64, macosx_arm64, 11.0, macos-14] + arch: [arm64, macosx_arm64, 12.0, macos-14] } ] name: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} @@ -122,13 +122,6 @@ jobs: run: | brew install pipx - - name: Reinstall gfortran to satisfy MacOS version requirements # NOTE: required only for x86_64 - if: startsWith(matrix.config.arch[0], 'x86_64') - env: - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} - run: | - brew reinstall gcc@11 - - name: Set up the configuration file run: | python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 1a235c2..81a5cd1 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,13 +1,13 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: workflow_dispatch +on: push jobs: compile_openblas: strategy: matrix: arch: - - [x86_64, SANDYBRIDGE, 10.9, macos-12] - - [arm64, ARMV8, 11.0, macos-14] + - [x86_64, SANDYBRIDGE, 12.0, macos-12] + - [arm64, ARMV8, 12.0, macos-14] name: ${{ matrix.arch[0] }} runs-on: ${{ matrix.arch[3] }} steps: From 867ea8ca86fd60693e3b8d9727ac131975dfab21 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Sat, 29 Jun 2024 11:13:22 +0200 Subject: [PATCH 41/51] ci: manually trigger workflow --- .github/workflows/compile_openblas_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 81a5cd1..cc5215a 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: push +on: workflow_dispatch jobs: compile_openblas: strategy: From 2ac7cd4d6dfad9eaf82da7215eae7a7a68dde694 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Mon, 1 Jul 2024 13:44:51 +0200 Subject: [PATCH 42/51] ci: add CIBW_ENVIRONMENT_MACOS env variable --- .github/workflows/build_wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index bb6c55f..34b9891 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -129,7 +129,8 @@ jobs: - name: Build wheel ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} uses: pypa/cibuildwheel@v2.19.1 env: - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} + CIBW_ENVIRONMENT_MACOS: > + MACOSX_DEPLOYMENT_TARGET=${{ matrix.config.arch[2] }} CIBW_PLATFORM: macos CIBW_BUILD: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} CIBW_ARCHS_MACOS: ${{ matrix.config.arch[0] }} From 5f264533046abc6bdfed82f7487307b5b11f1b0b Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 3 Jul 2024 14:02:54 +0200 Subject: [PATCH 43/51] refactor: call set() method in __init__ --- amico/models.pyx | 158 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 107 insertions(+), 51 deletions(-) diff --git a/amico/models.pyx b/amico/models.pyx index b51d952..73e19f2 100644 --- a/amico/models.pyx +++ b/amico/models.pyx @@ -240,12 +240,7 @@ class StickZeppelinBall( BaseModel ) : self.name = 'Stick-Zeppelin-Ball' self.maps_name = [ ] self.maps_descr = [ ] - - self.d_par = 1.7E-3 # Parallel diffusivity for the Stick [mm^2/s] - self.d_perp = 0 # Perpendicular diffusivity for the Stick [mm^2/s] - self.d_par_zep = 1.7E-3 # Parallel diffusivity for the Zeppelins [mm^2/s] - self.d_perps_zep = np.array([ 1.19E-3, 0.85E-3, 0.51E-3, 0.17E-3]) # Perpendicular diffusivitie(s) [mm^2/s] - self.d_isos = np.array([ 3.0E-3 ]) # Isotropic diffusivitie(s) [mm^2/s] + self.set() def set( @@ -256,6 +251,22 @@ class StickZeppelinBall( BaseModel ) : d_par_zep=1.7E-3, d_perp=0 ): + ''' + Set the parameters of the Stick-Zeppelin-Ball model. + + Parameters + ---------- + d_par : float + Parallel diffusivity for the Stick [mm^2/s] + d_perp : float + Perpendicular diffusivity for the Stick [mm^2/s] + d_par_zep : float + Parallel diffusivity for the Zeppelins [mm^2/s] + d_perps_zep : list of floats + Perpendicular diffusivitie(s) [mm^2/s] + d_isos : list of floats + Isotropic diffusivitie(s) [mm^2/s] + ''' self.d_par = d_par self.d_perp = d_perp if d_par_zep is None: @@ -383,12 +394,7 @@ class CylinderZeppelinBall( BaseModel ) : self.name = 'Cylinder-Zeppelin-Ball' self.maps_name = [ 'v', 'a', 'd' ] self.maps_descr = [ 'Intra-cellular volume fraction', 'Mean axonal diameter', 'Axonal density' ] - - self.d_par = 0.6E-3 # Parallel diffusivity [mm^2/s] - self.Rs = np.concatenate( ([0.01],np.linspace(0.5,8.0,20)) ) * 1E-6 # Radii of the axons [meters] - self.d_perps = np.array([ 1.19E-3, 0.85E-3, 0.51E-3, 0.17E-3]) # Perpendicular diffusivitie(s) [mm^2/s] - self.d_isos = np.array( [ 2.0E-3 ] ) # Isotropic diffusivitie(s) [mm^2/s] - self.isExvivo = False # Add dot compartment to dictionary (exvivo data) + self.set() def set( @@ -398,6 +404,20 @@ class CylinderZeppelinBall( BaseModel ) : d_perps=np.array([1.19E-3, 0.85E-3, 0.51E-3, 0.17E-3]), d_isos=np.array([2.0E-3]) ): + ''' + Set the parameters of the Cylinder-Zeppelin-Ball model. + + Parameters + ---------- + d_par : float + Parallel diffusivity [mm^2/s] + Rs : list of floats + Radii of the axons [meters] + d_perps : list of floats + Perpendicular diffusivitie(s) [mm^2/s] + d_isos : list of floats + Isotropic diffusivitie(s) [mm^2/s] + ''' self.d_par = d_par self.Rs = np.array(Rs) self.d_perps = np.array(d_perps) @@ -649,12 +669,7 @@ class NODDI( BaseModel ) : self.name = "NODDI" self.maps_name = [ 'NDI', 'ODI', 'FWF' ] self.maps_descr = [ 'Neurite Density Index', 'Orientation Dispersion Index', 'Free Water Fraction' ] - - self.dPar = 1.7E-3 - self.dIso = 3.0E-3 - self.IC_VFs = np.linspace(0.1,0.99,12) - self.IC_ODs = np.hstack((np.array([0.03, 0.06]),np.linspace(0.09,0.99,10))) - self.isExvivo = False + self.set() def set( @@ -665,6 +680,22 @@ class NODDI( BaseModel ) : IC_ODs=np.hstack((np.array([0.03, 0.06]), np.linspace(0.09, 0.99, 10))), isExvivo=False ): + ''' + Set the parameters of the NODDI model. + + Parameters + ---------- + dPar : float + Parallel diffusivity [mm^2/s] + dIso : float + Isotropic diffusivity [mm^2/s] + IC_VFs : list of floats + Intra-cellular volume fractions + IC_ODs : list of floats + Intra-cellular orientation dispersions + isExvivo : bool + Is ex-vivo data + ''' self.dPar = dPar self.dIso = dIso self.IC_VFs = np.array( IC_VFs ) if isinstance(IC_VFs, list) else IC_VFs @@ -967,50 +998,64 @@ class FreeWater( BaseModel ) : def __init__( self ) : self.id = 'FreeWater' self.name = 'Free-Water' - self.type = 'Human' - - if self.type == 'Mouse' : - self.maps_name = [ 'FiberVolume', 'FW', 'FW_blood', 'FW_csf' ] - self.maps_descr = [ 'fiber volume fraction', - 'Isotropic free-water volume fraction', - 'FW blood', 'FW csf' ] - - # for mouse imaging - self.d_par = 1.0E-3 - self.d_perps = np.linspace(0.15,0.55,10)*1E-3 - self.d_isos = [1.5e-3, 3e-3] - - else : - self.maps_name = [ 'FiberVolume', 'FW' ] - self.maps_descr = [ 'fiber volume fraction', - 'Isotropic free-water volume fraction'] - self.d_par = 1.0E-3 # Parallel diffusivity [mm^2/s] - self.d_perps = np.linspace(0.1,1.0,10)*1E-3 # Parallel diffusivities [mm^2/s] - self.d_isos = [ 2.5E-3 ] # Isotropic diffusivities [mm^2/s] + self.set() def set( self, - d_par=1.0E-3, - d_perps=np.linspace(0.1, 1.0, 10) * 1E-3, - d_isos=np.array([2.5E-3]), + d_par=None, + d_perps=None, + d_isos=None, type='Human' ): - self.d_par = d_par - self.d_perps = d_perps - self.d_isos = d_isos - self.type = type + ''' + Set the parameters of the Free-Water model. + Parameters + ---------- + d_par : float + Parallel diffusivity [mm^2/s] + d_perps : list of floats + Perpendicular diffusivities [mm^2/s] + d_isos : list of floats + Isotropic diffusivities [mm^2/s] + type : str + Type of data ('Human' or 'Mouse') + ''' + self.type = type if self.type == 'Mouse' : self.maps_name = [ 'FiberVolume', 'FW', 'FW_blood', 'FW_csf' ] self.maps_descr = [ 'fiber volume fraction', 'Isotropic free-water volume fraction', 'FW blood', 'FW csf' ] - + if d_par is None: + self.d_par = 1.0E-3 + else: + self.d_par = d_par + if d_perps is None: + self.d_perps = np.linspace(0.15, 0.55, 10) * 1E-3 + else: + self.d_perps = d_perps + if d_isos is None: + self.d_isos = [1.5E-3, 3E-3] + else: + self.d_isos = d_isos else : self.maps_name = [ 'FiberVolume', 'FW' ] self.maps_descr = [ 'fiber volume fraction', 'Isotropic free-water volume fraction'] + if d_par is None: + self.d_par = 1.0E-3 + else: + self.d_par = d_par + if d_perps is None: + self.d_perps = np.linspace(0.1, 1.0, 10) * 1E-3 + else: + self.d_perps = d_perps + if d_isos is None: + self.d_isos = [2.5E-3] + else: + self.d_isos = d_isos PRINT(' %s settings for Freewater elimination... ' % self.type) PRINT(' -iso compartments: ', self.d_isos) @@ -1252,6 +1297,7 @@ class VolumeFractions( BaseModel ) : self.name = 'Volume fractions' self.maps_name = [ ] self.maps_descr = [ ] + self.set() def set( self ) : @@ -1315,11 +1361,7 @@ class SANDI( BaseModel ) : self.name = 'SANDI' self.maps_name = [ 'fsoma', 'fneurite', 'fextra', 'Rsoma', 'Din', 'De' ] self.maps_descr = [ 'Intra-soma volume fraction', 'Intra-neurite volume fraction', 'Extra-cellular volume fraction', 'Apparent soma radius', 'Neurite axial diffusivity', 'Extra-cellular mean diffusivity' ] - - self.d_is = 3.0E-3 # Intra-soma diffusivity [mm^2/s] - self.Rs = np.linspace(1.0,12.0,5) * 1E-6 # Radii of the soma [meters] - self.d_in = np.linspace(0.25,3.0,5) * 1E-3 # Intra-neurite diffusivitie(s) [mm^2/s] - self.d_isos = np.linspace(0.25,3.0,5) * 1E-3 # Extra-cellular isotropic mean diffusivitie(s) [mm^2/s] + self.set() def set( @@ -1329,6 +1371,20 @@ class SANDI( BaseModel ) : d_in=np.linspace(0.25, 3.0, 5) * 1E-3, d_isos=np.linspace(0.25, 3.0, 5) * 1E-3 ): + ''' + Set the parameters of the SANDI model. + + Parameters + ---------- + d_is : float + Intra-soma diffusivity [mm^2/s] + Rs : list of floats + Radii of the soma [meters] + d_in : list of floats + Intra-neurite diffusivities [mm^2/s] + d_isos : list of floats + Extra-cellular isotropic mean diffusivities [mm^2/s] + ''' self.d_is = d_is self.Rs = np.array(Rs) self.d_in = np.array(d_in) From 53ae7c42e8846d4e62c556518955b23e72677c45 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 3 Jul 2024 15:57:38 +0200 Subject: [PATCH 44/51] ci: update artifacts name --- .github/workflows/build_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 34b9891..b12625c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -42,7 +42,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: wheels_${{ matrix.arch[1] }}_${{ matrix.py }} + name: wheels_${{ matrix.py }}_${{ matrix.arch[1] }} path: ./wheelhouse/*.whl if-no-files-found: error @@ -140,7 +140,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: wheels_macos_${{ matrix.config.arch[1] }}_${{ matrix.config.py }} + name: wheels_${{ matrix.config.py }}_${{ matrix.config.arch[1] }} path: ./wheelhouse/*.whl if-no-files-found: error @@ -188,7 +188,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: wheels_linux_${{ matrix.arch[1] }}_${{ matrix.py }} + name: wheels_${{ matrix.py }}_${{ matrix.arch[1] }} path: ./wheelhouse/*.whl if-no-files-found: error From 41697aed5db315b96ddd004660b455710584eb52 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 3 Jul 2024 15:58:19 +0200 Subject: [PATCH 45/51] ci: update publish_on_pypi.yml workflow --- .github/workflows/publish_on_pypi.yml | 150 +++----------------------- 1 file changed, 13 insertions(+), 137 deletions(-) diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index 08836b0..f849e60 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -14,78 +14,16 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - name: Download windows_AMD64 wheels - uses: dawidd6/action-download-artifact@v6 + - name: Download artifacts + uses: actions/download-artifact@v4 with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_windows_AMD64 + github-token: ${{ secrets.GH_PAT }} + run-id: ${{ secrets.ARTIFACTS_RUN_ID }} path: dist - search_artifacts: true - - - name: Download windows_x86 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_windows_x86 - path: dist - search_artifacts: true - - - name: Download macos_x86_64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_macos_x86_64 - path: dist - search_artifacts: true - - - name: Download macos_arm64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_macos_arm64 - path: dist - search_artifacts: true - - - name: Download linux_x86_64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_linux_x86_64 - path: dist - search_artifacts: true - - - name: Download linux_aarch64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_linux_aarch64 - path: dist - search_artifacts: true - - - name: Download source distribution - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: sdist - path: dist - search_artifacts: true + merge-multiple: true - name: Publish on PyPI - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@release/v1 with: skip-existing: true verbose: true @@ -101,80 +39,18 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - name: Download windows_AMD64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_windows_AMD64 - path: dist - search_artifacts: true - - - name: Download windows_x86 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_windows_x86 - path: dist - search_artifacts: true - - - name: Download macos_x86_64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_macos_x86_64 - path: dist - search_artifacts: true - - - name: Download macos_arm64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_macos_arm64 - path: dist - search_artifacts: true - - - name: Download linux_x86_64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_linux_x86_64 - path: dist - search_artifacts: true - - - name: Download linux_aarch64 wheels - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: wheels_linux_aarch64 - path: dist - search_artifacts: true - - - name: Download source distribution - uses: dawidd6/action-download-artifact@v6 + - name: Download artifacts + uses: actions/download-artifact@v4 with: - workflow: build_wheels.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: sdist + github-token: ${{ secrets.GH_PAT }} + run-id: ${{ secrets.ARTIFACTS_RUN_ID }} path: dist - search_artifacts: true + merge-multiple: true - name: Publish on PyPI Test - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@release/v1 with: - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ skip-existing: true verbose: true print-hash: true From a7a8cf38fd00d60024e50de0b878a20c334a3283 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 3 Jul 2024 16:09:39 +0200 Subject: [PATCH 46/51] ci: update secrets and artifact download system --- .github/workflows/build_wheels.yml | 29 ++++++++++++-------- .github/workflows/compile_openblas_linux.yml | 11 ++++++++ .github/workflows/compile_openblas_macos.yml | 11 ++++++++ .github/workflows/publish_on_pypi.yml | 4 +-- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index b12625c..7080314 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -108,14 +108,12 @@ jobs: uses: actions/checkout@v4 - name: Download compiled OpenBLAS - uses: dawidd6/action-download-artifact@v6 + uses: actions/download-artifact@v4 with: - workflow: compile_openblas_macos.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} + github-token: ${{ secrets.GH_PAT }} + run-id: ${{ secrets.OPENBLAS_MACOS_ARTIFACTS_RUN_ID }} name: OpenBLAS_macos_${{ matrix.config.arch[0] }} path: OpenBLAS - search_artifacts: true - name: Install pipx # NOTE: required only for arm64 if: startsWith(matrix.config.arch[0], 'arm64') @@ -158,14 +156,12 @@ jobs: uses: actions/checkout@v4 - name: Download compiled OpenBLAS - uses: dawidd6/action-download-artifact@v6 + uses: actions/download-artifact@v4 with: - workflow: compile_openblas_linux.yml - workflow_conclusion: success - commit: ${{github.event.pull_request.head.sha}} - name: OpenBLAS_linux_${{ matrix.arch[0] }} + github-token: ${{ secrets.GH_PAT }} + run-id: ${{ secrets.OPENBLAS_LINUX_ARTIFACTS_RUN_ID }} + name: OpenBLAS_linux_${{ matrix.config.arch[0] }} path: OpenBLAS - search_artifacts: true - name: Set up the configuration file run: | # NOTE: need to add '/host' because compilation is done in a Docker container @@ -215,3 +211,14 @@ jobs: name: sdist path: ./dist/*.tar.gz if-no-files-found: error + + run_id: + name: Create/Update WHEELS_ARTIFACTS_RUN_ID secret + runs-on: ubuntu-latest + needs: [build_windows_wheels, build_macos_wheels, build_linux_wheels, build_source_distribution] + steps: + - uses: actions/checkout@v4 + - run: | + gh secret set WHEELS_ARTIFACTS_RUN_ID --body ${{ github.run_id }} + env: + GH_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index eb18368..f55082d 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -32,3 +32,14 @@ jobs: name: OpenBLAS_linux_${{ matrix.arch[0] }} path: ./OpenBLAS if-no-files-found: error + + run_id: + name: Create/Update OPENBLAS_LINUX_ARTIFACTS_RUN_ID secret + runs-on: ubuntu-latest + needs: [compile_openblas] + steps: + - uses: actions/checkout@v4 + - run: | + gh secret set OPENBLAS_LINUX_ARTIFACTS_RUN_ID --body ${{ github.run_id }} + env: + GH_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index cc5215a..eef9e11 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -27,3 +27,14 @@ jobs: name: OpenBLAS_macos_${{ matrix.arch[0] }} path: ./OpenBLAS if-no-files-found: error + + run_id: + name: Create/Update OPENBLAS_MACOS_ARTIFACTS_RUN_ID secret + runs-on: ubuntu-latest + needs: [compile_openblas] + steps: + - uses: actions/checkout@v4 + - run: | + gh secret set OPENBLAS_MACOS_ARTIFACTS_RUN_ID --body ${{ github.run_id }} + env: + GH_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index f849e60..9b39aba 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -18,7 +18,7 @@ jobs: uses: actions/download-artifact@v4 with: github-token: ${{ secrets.GH_PAT }} - run-id: ${{ secrets.ARTIFACTS_RUN_ID }} + run-id: ${{ secrets.WHEELS_ARTIFACTS_RUN_ID }} path: dist merge-multiple: true @@ -43,7 +43,7 @@ jobs: uses: actions/download-artifact@v4 with: github-token: ${{ secrets.GH_PAT }} - run-id: ${{ secrets.ARTIFACTS_RUN_ID }} + run-id: ${{ secrets.WHEELS_ARTIFACTS_RUN_ID }} path: dist merge-multiple: true From 5359e0c7be4a77859d38efcdc542236cb81a4ecd Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Wed, 3 Jul 2024 18:36:21 +0200 Subject: [PATCH 47/51] ci: bump windows and linux runners --- .github/workflows/build_wheels.yml | 6 +++--- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/publish_on_pypi.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 7080314..d142a3d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -14,7 +14,7 @@ jobs: - [AMD64, win_amd64, x64] - [x86, win32, x86] name: ${{ matrix.py }}-${{ matrix.arch[1] }} - runs-on: windows-2019 + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -150,7 +150,7 @@ jobs: - [x86_64, manylinux_x86_64, amd64] - [aarch64, manylinux_aarch64, arm64] name: ${{ matrix.py }}-${{ matrix.arch[1] }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -190,7 +190,7 @@ jobs: build_source_distribution: name: sdist - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index f55082d..93d91fa 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -9,7 +9,7 @@ jobs: - [x86_64, manylinux2014_x86_64, HASWELL, amd64] - [aarch64, manylinux2014_aarch64, ARMV8, arm64] name: ${{ matrix.arch[0] }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 600 # NOTE: need this to compile the arm64 version steps: - name: Set up QEMU diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index 9b39aba..c2af123 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -7,7 +7,7 @@ jobs: publish_on_pypi: name: Publish on PyPI if: github.event.release.prerelease == false - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/project/dmri-amico @@ -32,7 +32,7 @@ jobs: publish_on_pypi_test: name: Publish on PyPI Test if: github.event.release.prerelease == true && contains(github.event.release.tag_name, 'rc') - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest environment: name: testpypi url: https://test.pypi.org/project/dmri-amico From 6b36df6ccd16238f7ea3c78ca17f86819b85572f Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Thu, 4 Jul 2024 11:14:27 +0200 Subject: [PATCH 48/51] docs: update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01e8f39..791b029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log ### All notable changes to `AMICO` will be documented in this file. -## `v2.0.2`
_2024-07-01_ +## `v2.0.2`
_2024-07-04_ ### ✨Added - Added `cp312` wheels to github actions From 60cbff31f4f26d3e0031a8f05be0883d01832e5f Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Thu, 4 Jul 2024 14:31:10 +0200 Subject: [PATCH 49/51] ci: trigger compile_openblas workflows on push --- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/compile_openblas_macos.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index 93d91fa..fbea723 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on Linux run-name: Compile OpenBLAS on Linux - ${{ github.sha }} -on: workflow_dispatch +on: push jobs: compile_openblas: strategy: diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index eef9e11..73613bb 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: workflow_dispatch +on: push jobs: compile_openblas: strategy: From d12759857677b5e3f5f9b59a94b5df063770fac0 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Thu, 4 Jul 2024 14:31:33 +0200 Subject: [PATCH 50/51] Revert "ci: trigger compile_openblas workflows on push" This reverts commit 60cbff31f4f26d3e0031a8f05be0883d01832e5f. --- .github/workflows/compile_openblas_linux.yml | 2 +- .github/workflows/compile_openblas_macos.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile_openblas_linux.yml b/.github/workflows/compile_openblas_linux.yml index fbea723..93d91fa 100644 --- a/.github/workflows/compile_openblas_linux.yml +++ b/.github/workflows/compile_openblas_linux.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on Linux run-name: Compile OpenBLAS on Linux - ${{ github.sha }} -on: push +on: workflow_dispatch jobs: compile_openblas: strategy: diff --git a/.github/workflows/compile_openblas_macos.yml b/.github/workflows/compile_openblas_macos.yml index 73613bb..eef9e11 100644 --- a/.github/workflows/compile_openblas_macos.yml +++ b/.github/workflows/compile_openblas_macos.yml @@ -1,6 +1,6 @@ name: Compile OpenBLAS on MacOS run-name: Compile OpenBLAS on MacOS - ${{ github.sha }} -on: push +on: workflow_dispatch jobs: compile_openblas: strategy: From c7349f516fdb0b55491c0de08ee7247db32d5fd0 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Thu, 4 Jul 2024 18:33:24 +0200 Subject: [PATCH 51/51] ci: fix wrong matrix --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d142a3d..c3cf833 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -160,7 +160,7 @@ jobs: with: github-token: ${{ secrets.GH_PAT }} run-id: ${{ secrets.OPENBLAS_LINUX_ARTIFACTS_RUN_ID }} - name: OpenBLAS_linux_${{ matrix.config.arch[0] }} + name: OpenBLAS_linux_${{ matrix.arch[0] }} path: OpenBLAS - name: Set up the configuration file