From 3b5578bfa2b9b1b0865f99bce92901cd6d771573 Mon Sep 17 00:00:00 2001 From: ssolson Date: Fri, 9 Aug 2024 09:03:20 -0400 Subject: [PATCH 1/2] 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 5dd83bbd99c4d009e2159f1bf7c7c7c81083849f Mon Sep 17 00:00:00 2001 From: ssolson Date: Tue, 3 Dec 2024 09:14:54 -0500 Subject: [PATCH 2/2] assign sortby to value --- mhkit/river/graphics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mhkit/river/graphics.py b/mhkit/river/graphics.py index 7272ded81..50ce5388b 100644 --- a/mhkit/river/graphics.py +++ b/mhkit/river/graphics.py @@ -76,7 +76,7 @@ def plot_flow_duration_curve(D, F, label=None, ax=None): """ # Sort by F temp = xr.Dataset(data_vars={"D": D, "F": F}) - temp.sortby("F", ascending=False) + temp = temp.sortby("F", ascending=False) ax = _xy_plot( temp["D"],