From 7ff8fa00f75ff2d7b86d012e1ed9196ffbe64361 Mon Sep 17 00:00:00 2001 From: emilien Date: Wed, 24 Jul 2024 17:48:47 +0200 Subject: [PATCH 1/4] fixed deprecation warning for numpy 1.20 by removing (np.int) from line 111 --- pylidc/Contour.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylidc/Contour.py b/pylidc/Contour.py index 24aa396..dfe6818 100644 --- a/pylidc/Contour.py +++ b/pylidc/Contour.py @@ -108,7 +108,7 @@ def to_matrix(self, include_k=True): else: k = np.ones(ij.shape[0])*self.image_k_position zs = self.annotation.contour_slice_zvals - return np.c_[ij, k].astype(int) + return np.c_[ij, k] Annotation.contours = relationship('Contour', order_by=Contour.id, From 6dfa554121300c5ca024629d00ded02402b1efcc Mon Sep 17 00:00:00 2001 From: emilien Date: Wed, 24 Jul 2024 17:56:04 +0200 Subject: [PATCH 2/4] fixed deprecation warning for numpy 1.20 by casting the array to np.int32 --- pylidc/Contour.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylidc/Contour.py b/pylidc/Contour.py index dfe6818..5a02896 100644 --- a/pylidc/Contour.py +++ b/pylidc/Contour.py @@ -108,7 +108,7 @@ def to_matrix(self, include_k=True): else: k = np.ones(ij.shape[0])*self.image_k_position zs = self.annotation.contour_slice_zvals - return np.c_[ij, k] + return np.int32(np.c_[ij, k]) Annotation.contours = relationship('Contour', order_by=Contour.id, From c8ca41f0cd53923e8c63d0f69c3fe7637d3abfbf Mon Sep 17 00:00:00 2001 From: emilien Date: Wed, 24 Jul 2024 18:01:47 +0200 Subject: [PATCH 3/4] fixed deprecation warning for numpy 1.20 by removing (np.int) from line 111, the ij array is a np.int64 already --- pylidc/Contour.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylidc/Contour.py b/pylidc/Contour.py index 5a02896..dfe6818 100644 --- a/pylidc/Contour.py +++ b/pylidc/Contour.py @@ -108,7 +108,7 @@ def to_matrix(self, include_k=True): else: k = np.ones(ij.shape[0])*self.image_k_position zs = self.annotation.contour_slice_zvals - return np.int32(np.c_[ij, k]) + return np.c_[ij, k] Annotation.contours = relationship('Contour', order_by=Contour.id, From 35859fc56ac8ec933fe5fc7fc1f1e218f02a81a5 Mon Sep 17 00:00:00 2001 From: emilien Date: Wed, 24 Jul 2024 19:04:57 +0200 Subject: [PATCH 4/4] addressing the numpy 1.20 deprecation error of .astype(int) by replacing it with .astype(np.int64) --- pylidc/Contour.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylidc/Contour.py b/pylidc/Contour.py index dfe6818..6aae6d4 100644 --- a/pylidc/Contour.py +++ b/pylidc/Contour.py @@ -108,7 +108,7 @@ def to_matrix(self, include_k=True): else: k = np.ones(ij.shape[0])*self.image_k_position zs = self.annotation.contour_slice_zvals - return np.c_[ij, k] + return np.c_[ij, k].astype(np.int64) Annotation.contours = relationship('Contour', order_by=Contour.id,