From f4d57814a28ba8da7639bc173e535d7c679e3b6e Mon Sep 17 00:00:00 2001 From: Edhain <123366140+Edhain@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:12:36 +0530 Subject: [PATCH 1/2] Update geometry.py Delaunay object in SciPy's scipy.spatial module no longer has an attribute called vertices. This attribute was deprecated in recent versions of SciPy and has been replaced by simplices. --- vmodel/geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmodel/geometry.py b/vmodel/geometry.py index e066aa4..a16a734 100644 --- a/vmodel/geometry.py +++ b/vmodel/geometry.py @@ -33,7 +33,7 @@ def voronoi_neighbors(positions: np.ndarray) -> list: """ tri = Delaunay(positions) neighbors = defaultdict(set) - for p in tri.vertices: + for p in tri.simplices: for i, j in combinations(p, 2): neighbors[i].add(j) neighbors[j].add(i) From 6c7d29109bb3ebf00585100da5505a66a3eb839a Mon Sep 17 00:00:00 2001 From: Edhain <123366140+Edhain@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:14:38 +0530 Subject: [PATCH 2/2] Update plot.py ptp was removed from the ndarray class in NumPy 2.0. The solution is to replace vor.points.ptp(axis=0) with np.ptp(vor.points, axis=0). --- vmodel/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmodel/plot.py b/vmodel/plot.py index f120722..c8eabbb 100644 --- a/vmodel/plot.py +++ b/vmodel/plot.py @@ -390,7 +390,7 @@ def voronoi_plot_2d(vor, ax=None, **kw): line_style = kw.get('line_style', 'solid') center = vor.points.mean(axis=0) - ptp_bound = vor.points.ptp(axis=0) + ptp_bound = np.ptp(vor.points, axis=0)) finite_segments = [] infinite_segments = []