|
4 | 4 | from scipy.spatial.distance import cdist |
5 | 5 | from scipy.stats import norm |
6 | 6 |
|
7 | | -from stumpy import config, core |
| 7 | +from stumpy import config, core, rng |
8 | 8 |
|
9 | 9 |
|
10 | 10 | def is_ptp_zero_1d(a, w): # `a` is 1-D |
@@ -1818,7 +1818,7 @@ def prescrump( |
1818 | 1818 | P = np.full((l, k), np.inf, dtype=np.float64) |
1819 | 1819 | I = np.full((l, k), -1, dtype=np.int64) |
1820 | 1820 |
|
1821 | | - for i in np.random.permutation(range(0, l, s)): |
| 1821 | + for i in rng.RNG.permutation(range(0, l, s)): |
1822 | 1822 | distance_profile = dist_matrix[i] |
1823 | 1823 | if exclusion_zone is not None: |
1824 | 1824 | apply_exclusion_zone(distance_profile, i, exclusion_zone, np.inf) |
@@ -1914,11 +1914,11 @@ def scrump( |
1914 | 1914 | pass |
1915 | 1915 |
|
1916 | 1916 | if exclusion_zone is not None: |
1917 | | - diags = np.random.permutation(range(exclusion_zone + 1, n_A - m + 1)).astype( |
| 1917 | + diags = rng.RNG.permutation(range(exclusion_zone + 1, n_A - m + 1)).astype( |
1918 | 1918 | np.int64 |
1919 | 1919 | ) |
1920 | 1920 | else: |
1921 | | - diags = np.random.permutation(range(-(n_A - m + 1) + 1, n_B - m + 1)).astype( |
| 1921 | + diags = rng.RNG.permutation(range(-(n_A - m + 1) + 1, n_B - m + 1)).astype( |
1922 | 1922 | np.int64 |
1923 | 1923 | ) |
1924 | 1924 |
|
@@ -1981,7 +1981,7 @@ def prescraamp(T_A, m, T_B, s, exclusion_zone=None, p=2.0, k=1): |
1981 | 1981 | P = np.full((l, k), np.inf, dtype=np.float64) |
1982 | 1982 | I = np.full((l, k), -1, dtype=np.int64) |
1983 | 1983 |
|
1984 | | - for i in np.random.permutation(range(0, l, s)): |
| 1984 | + for i in rng.RNG.permutation(range(0, l, s)): |
1985 | 1985 | distance_profile = distance_matrix[i] |
1986 | 1986 | if exclusion_zone is not None: |
1987 | 1987 | apply_exclusion_zone(distance_profile, i, exclusion_zone, np.inf) |
@@ -2054,11 +2054,11 @@ def scraamp(T_A, m, T_B, percentage, exclusion_zone, pre_scraamp, s, p=2.0, k=1) |
2054 | 2054 | l = n_A - m + 1 |
2055 | 2055 |
|
2056 | 2056 | if exclusion_zone is not None: |
2057 | | - diags = np.random.permutation(range(exclusion_zone + 1, n_A - m + 1)).astype( |
| 2057 | + diags = rng.RNG.permutation(range(exclusion_zone + 1, n_A - m + 1)).astype( |
2058 | 2058 | np.int64 |
2059 | 2059 | ) |
2060 | 2060 | else: |
2061 | | - diags = np.random.permutation(range(-(n_A - m + 1) + 1, n_B - m + 1)).astype( |
| 2061 | + diags = rng.RNG.permutation(range(-(n_A - m + 1) + 1, n_B - m + 1)).astype( |
2062 | 2062 | np.int64 |
2063 | 2063 | ) |
2064 | 2064 |
|
|
0 commit comments