Skip to content

Commit

Permalink
Fixed TDAmeritrade#989 Replaced np.NINF with -np.inf
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlaw committed Jun 17, 2024
1 parent 016b872 commit 93ba25a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions stumpy/stump.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ def _stump(
l = n_A - m + 1
n_threads = numba.config.NUMBA_NUM_THREADS

ρ = np.full((n_threads, l, k), np.NINF, dtype=np.float64)
ρ = np.full((n_threads, l, k), -np.inf, dtype=np.float64)
I = np.full((n_threads, l, k), -1, dtype=np.int64)

ρL = np.full((n_threads, l), np.NINF, dtype=np.float64)
ρL = np.full((n_threads, l), -np.inf, dtype=np.float64)
IL = np.full((n_threads, l), -1, dtype=np.int64)

ρR = np.full((n_threads, l), np.NINF, dtype=np.float64)
ρR = np.full((n_threads, l), -np.inf, dtype=np.float64)
IR = np.full((n_threads, l), -1, dtype=np.int64)

ndist_counts = core._count_diagonal_ndist(diags, m, n_A, n_B)
Expand Down
2 changes: 1 addition & 1 deletion tests/naive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,7 @@ def merge_topk_ρI(ρA, ρB, IA, IB):
k = ρA.shape[1]
for i in range(ρA.shape[0]):
_, _, overlap_idx_B = np.intersect1d(IA[i], IB[i], return_indices=True)
ρB[i, overlap_idx_B] = np.NINF
ρB[i, overlap_idx_B] = -np.inf
IB[i, overlap_idx_B] = -1

profile = np.column_stack((ρB, ρA))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_motifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def naive_motifs(T, m, max_motifs, max_matches, T_subseq_isconstant=None):
T_subseq_isconstant = naive.rolling_isconstant(T, m, T_subseq_isconstant)

output_shape = (max_motifs, max_matches)
motif_distances = np.full(output_shape, np.NINF, dtype=np.float64)
motif_distances = np.full(output_shape, -np.inf, dtype=np.float64)
motif_indices = np.full(output_shape, -1, dtype=np.int64)

D = naive.distance_matrix(T, T, m)
Expand Down

0 comments on commit 93ba25a

Please sign in to comment.