Skip to content

Commit

Permalink
matplotlib >=3.8 (#345)
Browse files Browse the repository at this point in the history
Bug fix by removing matplotlib version check needed for < 3.8.0
  • Loading branch information
ssolson committed Aug 13, 2024
1 parent a52e0c0 commit b6f47c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions mhkit/wave/contours.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b6f47c7

Please sign in to comment.