Skip to content

Commit e877016

Browse files
committed
update exception handling
1 parent 90e135d commit e877016

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

simcomplex/abssimcomplex.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def betti_number(self, i):
4646
else:
4747
try:
4848
boundop_i_rank = np.linalg.matrix_rank(boundop_i.toarray())
49-
except np.linalg.LinAlgError:
49+
except (np.linalg.LinAlgError, ValueError):
5050
boundop_i_rank = boundop_i.shape[1]
5151
try:
5252
boundop_ip1_rank = np.linalg.matrix_rank(boundop_ip1.toarray())
53-
except np.linalg.LinAlgError:
53+
except (np.linalg.LinAlgError, ValueError):
5454
boundop_ip1_rank = boundop_ip1.shape[1]
5555

5656
return ((boundop_i.shape[1]-boundop_i_rank)-boundop_ip1_rank)

0 commit comments

Comments
 (0)