diff --git a/docs/changes/2569.bugfix.rst b/docs/changes/2569.bugfix.rst new file mode 100644 index 00000000000..51025ebeadc --- /dev/null +++ b/docs/changes/2569.bugfix.rst @@ -0,0 +1 @@ +Replace deprecated usage of scipy sparse matrices, adds support for scipy 1.14. diff --git a/src/ctapipe/instrument/camera/geometry.py b/src/ctapipe/instrument/camera/geometry.py index 07eee6815d0..ab8aa84e94d 100644 --- a/src/ctapipe/instrument/camera/geometry.py +++ b/src/ctapipe/instrument/camera/geometry.py @@ -708,7 +708,7 @@ def neighbors(self): @lazyproperty def neighbor_matrix(self): - return self.neighbor_matrix_sparse.A + return self.neighbor_matrix_sparse.toarray() @lazyproperty def max_neighbors(self): @@ -941,7 +941,7 @@ def get_border_pixel_mask(self, width=1): warnings.filterwarnings("ignore", category=PendingDeprecationWarning) if width == 1: - n_neighbors = self.neighbor_matrix_sparse.sum(axis=1).A1 + n_neighbors = np.asarray(self.neighbor_matrix_sparse.sum(axis=0))[0] max_neighbors = n_neighbors.max() mask = n_neighbors < max_neighbors else: