Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stumpy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3717,7 +3717,7 @@ def check_ignore_trivial(T_A, T_B, ignore_trivial):
import numpy as np
import warnings

T = np.random.rand(10_000)
T = np.random.default_rng().random(10_000)
m = 50
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="Arrays T_A, T_B are equal")
Expand Down Expand Up @@ -4493,7 +4493,7 @@ def check_self_join(ignore_trivial):
import numpy as np
import warnings

T = np.random.rand(10_000)
T = np.random.default_rng().random(10_000)
m = 50
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="`ignore_trivial` cannot be `False`")
Expand Down
6 changes: 3 additions & 3 deletions stumpy/floss.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ def _iac(
IAC : numpy.ndarray
Idealized arc curve (IAC)
"""
np.random.seed(seed)
rng = np.random.default_rng(seed)

I = np.random.randint(0, width, size=width, dtype=np.int64)
I = rng.integers(0, width, size=width, dtype=np.int64)
if bidirectional is False: # Idealized 1-dimensional matrix profile index
I[:-1] = width
for i in range(width - 1):
I[i] = np.random.randint(i + 1, width, dtype=np.int64)
I[i] = rng.integers(i + 1, width, dtype=np.int64)

target_AC = _nnmark(I)

Expand Down
6 changes: 3 additions & 3 deletions stumpy/scraamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _preprocess_prescraamp(T_A, m, T_B=None, s=None):
else: # AB-join
s = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))

indices = np.random.permutation(range(0, l, s)).astype(np.int64)
indices = np.random.default_rng().permutation(range(0, l, s)).astype(np.int64)

return (T_A, T_B, T_A_subseq_isfinite, T_B_subseq_isfinite, indices, s, excl_zone)

Expand Down Expand Up @@ -718,7 +718,7 @@ def __init__(
core._merge_topk_PI(self._P, P, self._I, I)

if self._ignore_trivial:
self._diags = np.random.permutation(
self._diags = np.random.default_rng().permutation(
range(self._excl_zone + 1, self._n_A - self._m + 1)
).astype(np.int64)
if self._diags.shape[0] == 0: # pragma: no cover
Expand All @@ -728,7 +728,7 @@ def __init__(
f"Please try a value of `m <= {max_m}`"
)
else:
self._diags = np.random.permutation(
self._diags = np.random.default_rng().permutation(
range(-(self._n_A - self._m + 1) + 1, self._n_B - self._m + 1)
).astype(np.int64)

Expand Down
6 changes: 3 additions & 3 deletions stumpy/scrump.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _preprocess_prescrump(
else: # AB-join
s = int(np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM))

indices = np.random.permutation(range(0, l, s)).astype(np.int64)
indices = np.random.default_rng().permutation(range(0, l, s)).astype(np.int64)

return (
T_A,
Expand Down Expand Up @@ -997,7 +997,7 @@ def __init__(
core._merge_topk_PI(self._P, P, self._I, I)

if self._ignore_trivial:
self._diags = np.random.permutation(
self._diags = np.random.default_rng().permutation(
range(self._excl_zone + 1, self._n_A - self._m + 1)
).astype(np.int64)
if self._diags.shape[0] == 0: # pragma: no cover
Expand All @@ -1007,7 +1007,7 @@ def __init__(
f"Please try a value of `m <= {max_m}`"
)
else:
self._diags = np.random.permutation(
self._diags = np.random.default_rng().permutation(
range(-(self._n_A - self._m + 1) + 1, self._n_B - self._m + 1)
).astype(np.int64)

Expand Down
Loading