From cc939b1d082039ac97a83bc9389fb7fb3f04072f Mon Sep 17 00:00:00 2001 From: Ryan Murray <74630349+rywm-dhi@users.noreply.github.com> Date: Wed, 23 Oct 2024 09:53:46 +0200 Subject: [PATCH 1/4] Older versions of numpy that don't play nice withp python 3.12 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1ac12fd23..a313c39e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ exclude = ["notebooks", "tests"] name="modelskill" version="1.1.dev0" dependencies = [ - "numpy >= 1.20.0", + "numpy > 1.24.4", "pandas >= 1.4", "mikeio >= 1.2", "matplotlib", From e9611e379240d5ef8550765ea0af427e4d2fd43f Mon Sep 17 00:00:00 2001 From: Ryan Murray <74630349+rywm-dhi@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:00:20 +0200 Subject: [PATCH 2/4] Remove support for python 3.8 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a313c39e0..f95295f8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,14 +25,13 @@ authors = [ description="Compare results from simulations with observations." license="MIT" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "License :: OSI Approved :: MIT License", "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From d3a3053a750f0002274e0af7c5de7c31233c581d Mon Sep 17 00:00:00 2001 From: Ryan Murray <74630349+rywm-dhi@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:07:38 +0200 Subject: [PATCH 3/4] Fix static types --- modelskill/comparison/_collection_plotter.py | 4 ++-- modelskill/comparison/_comparer_plotter.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modelskill/comparison/_collection_plotter.py b/modelskill/comparison/_collection_plotter.py index 53cde0a6e..9e7769f44 100644 --- a/modelskill/comparison/_collection_plotter.py +++ b/modelskill/comparison/_collection_plotter.py @@ -34,7 +34,7 @@ def __init__(self, cc: ComparerCollection) -> None: self.cc = cc self.is_directional = False - def __call__(self, *args: Any, **kwds: Any) -> Any: + def __call__(self, *args: Any, **kwds: Any) -> Axes | list[Axes]: return self.scatter(*args, **kwds) def scatter( @@ -59,7 +59,7 @@ def scatter( skill_table: Optional[Union[str, List[str], bool]] = None, ax: Optional[Axes] = None, **kwargs, - ) -> Axes: + ) -> Axes | list[Axes]: """Scatter plot showing compared data: observation vs modelled Optionally, with density histogram. diff --git a/modelskill/comparison/_comparer_plotter.py b/modelskill/comparison/_comparer_plotter.py index 398a74610..b066bcbb4 100644 --- a/modelskill/comparison/_comparer_plotter.py +++ b/modelskill/comparison/_comparer_plotter.py @@ -48,7 +48,9 @@ def __init__(self, comparer: Comparer) -> None: self.comparer = comparer self.is_directional = comparer.quantity.is_directional - def __call__(self, *args, **kwargs) -> matplotlib.axes.Axes: + def __call__( + self, *args, **kwargs + ) -> matplotlib.axes.Axes | list[matplotlib.axes.Axes]: """Plot scatter plot of modelled vs observed data""" return self.scatter(*args, **kwargs) @@ -485,7 +487,7 @@ def scatter( skill_table: Optional[Union[str, List[str], bool]] = None, ax: Optional[matplotlib.axes.Axes] = None, **kwargs, - ) -> matplotlib.axes.Axes: + ) -> matplotlib.axes.Axes | list[matplotlib.axes.Axes]: """Scatter plot showing compared data: observation vs modelled Optionally, with density histogram. From bee6a58505055e3be8325ddc030efb3f99a1a41e Mon Sep 17 00:00:00 2001 From: Ryan Murray <74630349+rywm-dhi@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:10:41 +0200 Subject: [PATCH 4/4] Remove legacy CI test for python 3.8 --- .github/workflows/legacy_test.yml | 33 ------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/legacy_test.yml diff --git a/.github/workflows/legacy_test.yml b/.github/workflows/legacy_test.yml deleted file mode 100644 index 7e9e7699b..000000000 --- a/.github/workflows/legacy_test.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Legacy test - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - - name: Install older dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements_min.txt - pip install pytest - - - name: Install modelskill - run: | - pip install .[test] - - name: Test with pytest - run: | - pytest --ignore tests/notebooks/