From 71a9c03c42b7dd37e1acd7e8c3759db128cbe935 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sun, 18 Aug 2024 16:24:49 -0600 Subject: [PATCH 1/4] Try this --- .github/workflows/build_multi_numpy_scipy.yml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 .github/workflows/build_multi_numpy_scipy.yml diff --git a/.github/workflows/build_multi_numpy_scipy.yml b/.github/workflows/build_multi_numpy_scipy.yml new file mode 100644 index 00000000..ed4c54ac --- /dev/null +++ b/.github/workflows/build_multi_numpy_scipy.yml @@ -0,0 +1,129 @@ +name: Build-Test-Multi-Scipy-Numpy +on: + push: + branches: [master, release, multi_numpy_scipy_test] + pull_request: + branches: [master, release] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + numpy: ['2.0.1'] #['1.16.5', '1.18.5', '1.20.3', '1.22.4', '1.24.4', '1.26.4', '2.0.1'] + scipy: ['1.14.0'] #['1.7.3', '1.8.1', '1.9.3', '1.10.1', '1.12.0', '1.14.0'] + python-version: ['3.10'] #['3.7', '3.8', '3.9', '3.10'] + os: [ubuntu-latest] + architecture: ['x64'] + include: + - numpy: '1.16.5' + scipy: '1.7.3' + python-version: '3.7' + - numpy: '1.18.5' + scipy: '1.7.3' + python-version: '3.7' + - numpy: '1.18.5' + scipy: '1.8.1' + python-version: '3.8' + - numpy: '1.18.5' + scipy: '1.9.3' + python-version: '3.8' + - numpy: '1.20.3' + scipy: '1.7.3' + python-version: '3.7' + - numpy: '1.20.3' + scipy: '1.7.3' + python-version: '3.8' + - numpy: '1.20.3' + scipy: '1.8.1' + python-version: '3.8' + - numpy: '1.20.3' + scipy: '1.9.3' + python-version: '3.8' + - numpy: '1.20.3' + scipy: '1.10.1' + python-version: '3.8' + - numpy: '1.22.4' + scipy: '1.7.3' + python-version: '3.8' + - numpy: '1.22.4' + scipy: '1.9.3' + python-version: '3.8' + - numpy: '1.22.4' + scipy: '1.10.1' + python-version: '3.8' + - numpy: '1.24.4' + scipy: '1.8.1' + python-version: '3.8' + - numpy: '1.24.4' + scipy: '1.9.3' + python-version: '3.10' + - numpy: '1.24.4' + scipy: '1.10.1' + python-version: '3.8' + - numpy: '1.24.4' + scipy: '1.12.0' + python-version: '3.9' + - numpy: '1.26.4' + scipy: '1.10.1' + python-version: '3.9' + - numpy: '1.26.4' + scipy: '1.12.0' + python-version: '3.9' + - numpy: '1.26.4' + scipy: '1.14.0' + python-version: '3.10' + - numpy: '2.0.1' + scipy: '1.14.0' + python-version: '3.10' + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} + - name: cache Linux + uses: actions/cache@v4 + if: startsWith(runner.os, 'Linux') + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements_test.txt') }} + restore-keys: | + ${{ runner.os }}-${{ runner.architecture }}-${{ runner.python-version }}pip- + - name: Install Ubuntu dependencies + if: startsWith(runner.os, 'Linux') + run: | + # Taken from scipy + sudo apt-get update + sudo apt-get install -y libopenblas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache libmpc-dev + + - name: Install dependencies + run: | + python -c "import platform; print(platform.platform()); print(platform.architecture())" + python -m pip install --upgrade pip + python -m pip install wheel + pip install -r requirements_test.txt + pip install numpy==${{ matrix.numpy }} scipy==${{ matrix.scipy }} + - name: Add numba + if: ${{ matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10' || matrix.python-version == '3.11' || matrix.python-version == '3.12' }} + run: | + pip install numba + - name: Install thermo + run: | + pip install . + - name: Generate Files + if: ${{ matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10' || matrix.python-version == '3.11' || matrix.python-version == '3.12' || matrix.python-version == 'pypy3.9' }} + run: | + python dev/dump_UNIFAC_assignments_to_sqlite.py + - name: Uninstall thermo + run: | + pip uninstall -y thermo + - name: Test with pytest + run: | + pytest . -v --cov-report html --cov=thermo --cov-report term-missing -m "not online and not sympy and not numba and not CoolProp and not fuzz and not deprecated and not slow" + env: + COVERALLS_REPO_TOKEN: ${{ secrets.coveralls }} + COVERALLS_PARALLEL: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7f5d6ad508f8eae933ddbf4b1fef06aa4eaec9dc Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sun, 18 Aug 2024 16:36:17 -0600 Subject: [PATCH 2/4] Fixes --- conftest.py | 2 +- thermo/utils/tp_dependent_property.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index 2c7ef75b..c9fe03f8 100644 --- a/conftest.py +++ b/conftest.py @@ -15,7 +15,7 @@ def pytest_ignore_collect(path): return True if 'conf.py' in path: return True - if ver_tup < (3, 7) or ver_tup >= (3, 13) or is_pypy: + if ver_tup <= (3, 7) or ver_tup >= (3, 13) or is_pypy: # numba does not yet run under pypy if 'numba' in path: return True diff --git a/thermo/utils/tp_dependent_property.py b/thermo/utils/tp_dependent_property.py index eadd5b06..aa331ed7 100644 --- a/thermo/utils/tp_dependent_property.py +++ b/thermo/utils/tp_dependent_property.py @@ -485,7 +485,7 @@ def interpolate_P(self, T, P, name): # Only allow linear extrapolation, but with whatever transforms are specified # extrapolator = RectBivariateSpline(Ts2_sorted, Ps2_sorted, properties2_sorted.T, kx=1, ky=1, s=0) # interpolation if fill value is missing - extrapolator = RegularGridInterpolator((Ts2_sorted, Ps2_sorted), properties2_sorted.T, method='slinear', fill_value=None, bounds_error=False) # interpolation if fill value is missing + extrapolator = RegularGridInterpolator((Ts2_sorted, Ps2_sorted), properties2_sorted.T, method='linear', fill_value=None, bounds_error=False) # interpolation if fill value is missing # If more than 5 property points, create a spline interpolation if len(properties) >= 5: spline = RectBivariateSpline(Ts2_sorted, Ps2_sorted, properties2_sorted.T, kx=3, ky=3, s=0) From d6d454fefa9562120b9f9f404a8de21cf49597a9 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sun, 18 Aug 2024 16:41:09 -0600 Subject: [PATCH 3/4] 3.7 versions don't work with sqlalchemy --- .github/workflows/build_multi_numpy_scipy.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build_multi_numpy_scipy.yml b/.github/workflows/build_multi_numpy_scipy.yml index ed4c54ac..40902525 100644 --- a/.github/workflows/build_multi_numpy_scipy.yml +++ b/.github/workflows/build_multi_numpy_scipy.yml @@ -17,21 +17,12 @@ jobs: os: [ubuntu-latest] architecture: ['x64'] include: - - numpy: '1.16.5' - scipy: '1.7.3' - python-version: '3.7' - - numpy: '1.18.5' - scipy: '1.7.3' - python-version: '3.7' - numpy: '1.18.5' scipy: '1.8.1' python-version: '3.8' - numpy: '1.18.5' scipy: '1.9.3' python-version: '3.8' - - numpy: '1.20.3' - scipy: '1.7.3' - python-version: '3.7' - numpy: '1.20.3' scipy: '1.7.3' python-version: '3.8' From 0e540745c58ea7a560467fa211a810cccd5602a7 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Mon, 26 Aug 2024 19:31:17 -0600 Subject: [PATCH 4/4] Ready to merge multi numpy/scipy version tests --- .github/workflows/build_multi_numpy_scipy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_multi_numpy_scipy.yml b/.github/workflows/build_multi_numpy_scipy.yml index 40902525..a5cab5ab 100644 --- a/.github/workflows/build_multi_numpy_scipy.yml +++ b/.github/workflows/build_multi_numpy_scipy.yml @@ -1,7 +1,7 @@ name: Build-Test-Multi-Scipy-Numpy on: push: - branches: [master, release, multi_numpy_scipy_test] + branches: [release] pull_request: branches: [master, release]