From 3b5578bfa2b9b1b0865f99bce92901cd6d771573 Mon Sep 17 00:00:00 2001 From: ssolson Date: Fri, 9 Aug 2024 09:03:20 -0400 Subject: [PATCH 1/4] matplotlib >=3.8 --- environment.yml | 2 +- mhkit/wave/contours.py | 8 +------- requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/environment.yml b/environment.yml index ac679176d..ee1b37bf0 100644 --- a/environment.yml +++ b/environment.yml @@ -8,7 +8,7 @@ dependencies: - pandas>=1.0.0 - numpy>=1.21.0, <2.0.0 - scipy<=1.13.1 - - matplotlib + - matplotlib>=3.8.0 - requests - lxml - scikit-learn diff --git a/mhkit/wave/contours.py b/mhkit/wave/contours.py index 905c560b8..b2a054c4c 100644 --- a/mhkit/wave/contours.py +++ b/mhkit/wave/contours.py @@ -8,11 +8,8 @@ import numpy as np import warnings from mhkit.utils import to_numeric_array - import matplotlib -mpl_version = tuple(map(int, matplotlib.__version__.split("."))) - # Contours def environmental_contours(x1, x2, sea_state_duration, return_period, method, **kwargs): @@ -1696,10 +1693,7 @@ def _bivariate_KDE(x1, x2, bw, fit, nb_steps, Ndata_bivariate_KDE, kwargs): x1_bivariate_KDE = [] x2_bivariate_KDE = [] - if mpl_version < (3, 8): # For versions before 3.8 - segments = vals.allsegs[0] - else: - segments = [path.vertices for path in vals.get_paths()] + segments = [path.vertices for path in vals.get_paths()] for seg in segments: x1_bivariate_KDE.append(seg[:, 1]) diff --git a/requirements.txt b/requirements.txt index 381f1068f..1f68d7614 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ pandas>=1.0.0 numpy>=1.21.0, <2.0.0 scipy<=1.13.1 -matplotlib +matplotlib>=3.8.0 requests pecos>=0.3.0 fatpack diff --git a/setup.py b/setup.py index c30ff2e9f..8d2825b3b 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ "pandas>=1.0.0", "numpy>=1.21.0, <2.0.0", "scipy<=1.13.1", - "matplotlib", + "matplotlib>=3.8.0", "requests", "pecos>=0.3.0", "fatpack", From 09b41d0cf21bdf65970686cd28fb669ca91f6c58 Mon Sep 17 00:00:00 2001 From: ssolson Date: Wed, 4 Sep 2024 10:10:58 -0400 Subject: [PATCH 2/4] Run on python 3.12 --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9513dd72e..e0cf49d92 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Py 3.10, 3.11 | Windows Mac Linux +name: Py 3.10, 3.11, 3.12 | Windows Mac Linux on: push: @@ -184,7 +184,7 @@ jobs: fail-fast: false matrix: os: ${{fromJson(needs.set-os.outputs.matrix_os)}} - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] env: PYTHON_VER: ${{ matrix.python-version }} @@ -235,7 +235,7 @@ jobs: fail-fast: false matrix: os: ${{fromJson(needs.set-os.outputs.matrix_os)}} - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: conda-incubator/setup-miniconda@v3 @@ -291,7 +291,7 @@ jobs: fail-fast: false matrix: os: ${{fromJson(needs.set-os.outputs.matrix_os)}} - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 From cc8fc08b038b4eb6f4eb74629eb5d8c7426c5274 Mon Sep 17 00:00:00 2001 From: ssolson Date: Wed, 4 Sep 2024 10:53:34 -0400 Subject: [PATCH 3/4] allow 3.12 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index ee1b37bf0..5e963b4b0 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python>=3.8,<3.12 + - python>=3.10 - pip - pandas>=1.0.0 - numpy>=1.21.0, <2.0.0 From 8aeab58789a5b1f1c5a153accba556611f122941 Mon Sep 17 00:00:00 2001 From: ssolson Date: Fri, 6 Sep 2024 10:54:26 -0400 Subject: [PATCH 4/4] install setuptools for hypyd on 3.12 --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0cf49d92..44d8ac03a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -260,6 +260,10 @@ jobs: python -m pip install --upgrade pip wheel pip install coverage pytest coveralls . + - name: Install setuptools for Python 3.12 + if: matrix.python-version == '3.12' + run: pip install setuptools + - name: Run pytest & generate coverage report shell: bash -l {0} run: |