|
7 | 7 | from pytest_mock.plugin import MockerFixture |
8 | 8 | from io import StringIO |
9 | 9 |
|
10 | | -from qolmat.utils.exceptions import SignalTooShort |
| 10 | +from qolmat.utils.exceptions import NotDimension2, SignalTooShort |
11 | 11 |
|
12 | 12 |
|
13 | 13 | df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9]}) |
@@ -77,7 +77,7 @@ def test_utils_utils_acf(values, lag_max): |
77 | 77 | @pytest.mark.parametrize( |
78 | 78 | "method, X_expected", [("mean", X_exp_mean), ("median", X_exp_median), ("zeros", X_exp_zeros)] |
79 | 79 | ) |
80 | | -def test_rpca_utils_impute_nans(X: NDArray, method: str, X_expected: NDArray): |
| 80 | +def test_utils_utils_impute_nans(X: NDArray, method: str, X_expected: NDArray): |
81 | 81 | result = utils.impute_nans(M=X, method=method) |
82 | 82 | np.testing.assert_allclose(result, X_expected) |
83 | 83 |
|
@@ -114,32 +114,32 @@ def test_utils_linear_interpolation(X: NDArray): |
114 | 114 |
|
115 | 115 |
|
116 | 116 | @pytest.mark.parametrize("X", [X_incomplete]) |
117 | | -def test_rpca_prepare_data_2D_succeed(X: NDArray): |
| 117 | +def test_utils_prepare_data_2D_succeed(X: NDArray): |
118 | 118 | result = utils.prepare_data(X, 1) |
119 | 119 | np.testing.assert_allclose(result, X_incomplete) |
120 | 120 |
|
121 | 121 |
|
122 | 122 | @pytest.mark.parametrize("X", [X_incomplete]) |
123 | | -def test_rpca_prepare_data_1D_succeed(X: NDArray): |
| 123 | +def test_utils_prepare_data_1D_succeed(X: NDArray): |
124 | 124 | X = X.flatten() |
125 | 125 | result = utils.prepare_data(X, 5) |
126 | 126 | np.testing.assert_allclose(result, X_incomplete) |
127 | 127 |
|
128 | 128 |
|
129 | 129 | @pytest.mark.parametrize("X", [X_incomplete]) |
130 | | -def test_rpca_prepare_data_2D_uneven(X: NDArray): |
| 130 | +def test_utils_prepare_data_2D_uneven(X: NDArray): |
131 | 131 | result = utils.prepare_data(X, 3) |
132 | 132 | np.testing.assert_allclose(result.shape, (15, 2)) |
133 | 133 |
|
134 | 134 |
|
135 | 135 | @pytest.mark.parametrize("X", [X_incomplete]) |
136 | | -def test_rpca_prepare_data_consistant(X: NDArray): |
| 136 | +def test_utils_prepare_data_consistant(X: NDArray): |
137 | 137 | result1 = utils.prepare_data(X, 1) |
138 | 138 | result2 = utils.prepare_data(result1, 2) |
139 | 139 | result3 = utils.prepare_data(X, 2) |
140 | 140 | np.testing.assert_allclose(result2, result3) |
141 | 141 |
|
142 | 142 |
|
143 | | -@pytest.mark.parametrize("X", [X_incomplete]) |
144 | | -def test_rpca_prepare_data_2D_fail(X: NDArray): |
145 | | - np.testing.assert_raises(SignalTooShort, utils.prepare_data, X, 100) |
| 143 | +@pytest.mark.parametrize("X", [signal]) |
| 144 | +def test_utils_fold_signal_1D_fail(X: NDArray): |
| 145 | + np.testing.assert_raises(NotDimension2, utils.fold_signal, X, 100) |
0 commit comments