diff --git a/environment.yml b/environment.yml index 553d892..1ad8343 100644 --- a/environment.yml +++ b/environment.yml @@ -17,7 +17,7 @@ dependencies: - scipy - numba - numpy>=1.21 # numpy.typing - - matplotlib + - matplotlib>=3.8 - mpi4py - pyarrow - pytz diff --git a/ocsmesh/raster.py b/ocsmesh/raster.py index 7287e95..915e0e6 100644 --- a/ocsmesh/raster.py +++ b/ocsmesh/raster.py @@ -1455,15 +1455,18 @@ def _get_raster_contour_single_window( ax.contour(x, y, values, levels=[level]) _logger.debug(f'Took {time()-start}...') plt.close(fig) - for path_collection in ax.collections: - for path in path_collection.get_paths(): - # LineStrings must have at least 2 coordinate tuples - if len(path.vertices) < 2: - continue - try: - features.append(LineString(path.vertices)) - except ValueError: - pass + + for path_collection in ax.collections[:]: + for path in path_collection.allsegs: + # LineStrings must have at least 2 coordinate tuples + for p in path: + if len(p) < 2: + continue + try: + features.append(LineString(p)) + except ValueError: + pass + return ops.linemerge(features) def _get_raster_contour_feathered( diff --git a/pyproject.toml b/pyproject.toml index e68b9bd..63217fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ readme = "README.md" requires-python = '>=3.9' # 3.8 -> scipy dependencies = [ "colored-traceback", "fiona", "geopandas", - "jigsawpy", "matplotlib", "netCDF4", "numba", + "jigsawpy", "matplotlib>=3.8", "netCDF4", "numba", "numpy>=1.21", # introduce npt.NDArray "pyarrow", "rtree", "pyproj>=3.0", "rasterio", "scipy", "shapely", "triangle", "typing_extensions", "utm", diff --git a/tests/api/hfun.py b/tests/api/hfun.py index 1362151..f1bf4d7 100755 --- a/tests/api/hfun.py +++ b/tests/api/hfun.py @@ -515,7 +515,7 @@ def test_calculated_size(self): hfun_val_diff = self.hfun_orig_val - hfun_calc_val # TODO: Come up with a more robust criteria! - threshold = 0.05 + threshold = 0.06 err_value = np.mean(np.abs(hfun_val_diff))/np.mean(self.hfun_orig_val) self.assertTrue(err_value < threshold)