Skip to content

Commit

Permalink
TST: cluster: fix result type of calculate_maximum_inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascolley committed Sep 21, 2023
1 parent 11fcf33 commit 4bdec24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scipy/cluster/tests/test_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ def test_dendrogram_leaf_colors(self, xp):
def calculate_maximum_distances(Z, xp):
# Used for testing correctness of maxdists.
n = Z.shape[0] + 1
B = xp.zeros((n-1,))
B = xp.zeros((n-1,), dtype=Z.dtype)
q = xp.zeros((3,))
for i in range(0, n - 1):
q[:] = 0.0
Expand All @@ -1210,7 +1210,8 @@ def calculate_maximum_distances(Z, xp):
def calculate_maximum_inconsistencies(Z, R, k=3, xp=np):
# Used for testing correctness of maxinconsts.
n = Z.shape[0] + 1
B = xp.zeros((n-1,))
dtype = xp.result_type(Z, R)
B = xp.zeros((n-1,), dtype=dtype)
q = xp.zeros((3,))
for i in range(0, n - 1):
q[:] = 0.0
Expand Down

0 comments on commit 4bdec24

Please sign in to comment.