Skip to content

Commit

Permalink
Support scipy 1.14, fixes #2568
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jun 26, 2024
1 parent f6202a8 commit 2903790
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changes/2569.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace deprecated usage of scipy sparse matrices, adds support for scipy 1.14.
4 changes: 2 additions & 2 deletions src/ctapipe/instrument/camera/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2903790

Please sign in to comment.