From 7ce59066ef0ef5cbe7e64e3028546ae7e6ef89f6 Mon Sep 17 00:00:00 2001 From: Nicola Omodei Date: Fri, 2 Feb 2024 10:48:37 -0800 Subject: [PATCH 1/6] Removing an error if alpha is less than beta --- astromodels/functions/functions_1D/powerlaws.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astromodels/functions/functions_1D/powerlaws.py b/astromodels/functions/functions_1D/powerlaws.py index fbd5f6e4..18196b0a 100644 --- a/astromodels/functions/functions_1D/powerlaws.py +++ b/astromodels/functions/functions_1D/powerlaws.py @@ -820,7 +820,7 @@ def evaluate(self, x, K, alpha, xp, beta, piv): E0 = old_div(xp, (2 + alpha)) if alpha < beta: - raise ModelAssertionViolation("Alpha cannot be less than beta") + alpha=beta#raise ModelAssertionViolation("Alpha cannot be less than beta") if isinstance(x, astropy_units.Quantity): alpha_ = alpha.value From 4f76d1b5851fb381042334e319073aee738fe9f1 Mon Sep 17 00:00:00 2001 From: Nicola Omodei Date: Fri, 2 Feb 2024 11:00:41 -0800 Subject: [PATCH 2/6] Added tests on newer versions of python --- .github/workflows/test_and_build.yml | 7 ++++--- ci/environment.yml | 4 ++-- docs/requirements.txt | 2 +- setup.cfg | 10 +++------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 00ea8282..72c91e0a 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -35,8 +35,9 @@ jobs: if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} strategy: matrix: - python-version: [3.7, 3.8, 3.9] - runs-on: ubuntu-latest + python-version: [3.9, 3.10, 3.11, 3.12] + os: ["ubuntu-latest", "macos-latest"] + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v2 @@ -85,7 +86,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest"] - python-version: [3.7, 3.9] + python-version: [3.9] runs-on: ${{ matrix.os }} steps: - name: Checkout diff --git a/ci/environment.yml b/ci/environment.yml index 9a23df40..79fcd899 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -22,9 +22,9 @@ dependencies: - wcslib - future - xspec-modelsonly==6.30.1 - - numba>=0.54 + - numba<0.59 - h5py<3.2 - - interpolation>=2.2.2 + - interpolation>=2.2.3 - libgfortran - colorama - rich diff --git a/docs/requirements.txt b/docs/requirements.txt index 3a14a876..003f6e4b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,5 +7,5 @@ nbsphinx cython numpy pandas -numba +numba<0.59 sphinx_rtd_dark_mode diff --git a/setup.cfg b/setup.cfg index c45622ba..b133696f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,7 @@ url = https://github.com/threeml/astromodels author_email = giacomo.vianello@gmail.com author = Giacomo Vianello -requires_python = >=2.7.0 +requires_python = >=3.9.0 project_urls = @@ -23,11 +23,7 @@ classifiers = Topic :: Scientific/Engineering :: Astronomy Intended Audience :: Science/Research Operating System :: POSIX - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 Environment :: Console [options] @@ -41,7 +37,7 @@ install_requires = dill future interpolation>=2.2.3 - numba>0.52 + numba<0.59 h5py pandas tables From b49c0d0080b5a86715b7ca4e27fda703ce0f9f4e Mon Sep 17 00:00:00 2001 From: Nicola Omodei Date: Fri, 2 Feb 2024 11:09:56 -0800 Subject: [PATCH 3/6] trying again --- .github/workflows/test_and_build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 0948167f..db31ac9a 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -34,8 +34,9 @@ jobs: needs: skip_duplicate if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} strategy: + fail-fast: false matrix: - python-version: [3.9, 3.10, 3.11, 3.12] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: ["ubuntu-latest", "macos-latest"] runs-on: ${{ matrix.os }} steps: From 5462dc01fdf6c9ab833cea7cb9a9ab1e066c58f9 Mon Sep 17 00:00:00 2001 From: Nicola Omodei Date: Fri, 2 Feb 2024 11:43:48 -0800 Subject: [PATCH 4/6] install master version of interpolate --- .github/workflows/test_and_build.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index db31ac9a..12dbd5ab 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11"] os: ["ubuntu-latest", "macos-latest"] runs-on: ${{ matrix.os }} steps: @@ -50,6 +50,7 @@ jobs: run: | python -m pip install --upgrade pip wheel pip install --upgrade flake8 coverage pytest-cov cython + pip install git+https://github.com/EconForge/interpolation.py.git pip install -e . - name: Lint with flake8 run: | @@ -65,9 +66,16 @@ jobs: NUMEXPR_NUM_THREADS: 1 MPLBACKEND: "Agg" - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v1 - if: always() + - name: Publish Unit Test Results Ubuntu + uses: EnricoMi/publish-unit-test-result-action@v2 + if: matrix.os=="ubuntu-latest" + with: + files: junit/test-*.xml + comment_mode: off + + - name: Publish Unit Test Results MacOS + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + if: matrix.os=="macos-latest" with: files: junit/test-*.xml comment_mode: off From 9be9dfa967f16c221c873ecf9440c1e5ae76644a Mon Sep 17 00:00:00 2001 From: Nicola Omodei Date: Fri, 2 Feb 2024 11:49:49 -0800 Subject: [PATCH 5/6] fix workflow --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 12dbd5ab..9213d482 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -68,14 +68,14 @@ jobs: - name: Publish Unit Test Results Ubuntu uses: EnricoMi/publish-unit-test-result-action@v2 - if: matrix.os=="ubuntu-latest" + if: runner.os == 'Linux' with: files: junit/test-*.xml comment_mode: off - name: Publish Unit Test Results MacOS uses: EnricoMi/publish-unit-test-result-action/composite@v2 - if: matrix.os=="macos-latest" + if: runner.os == 'macOS' with: files: junit/test-*.xml comment_mode: off From 582bc4afb9567122f8dc6a55d290de56992c404e Mon Sep 17 00:00:00 2001 From: Nicola Omodei Date: Fri, 2 Feb 2024 13:38:46 -0800 Subject: [PATCH 6/6] Update upload/download artifacts --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 27a02741..317716d6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -77,7 +77,7 @@ jobs: ls docs/notebooks - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: notebooks-for-${{ github.sha }} path: docs/notebooks @@ -133,7 +133,7 @@ jobs: sphinx-apidoc -f -o docs/api/ astromodels - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: api-stubs-for-${{ github.sha }} path: docs/api