Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

473 replace assert nparray equal by nptestingassert array equal in all mapie unit tests #485

Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ History
0.8.x (2024-xx-xx)
------------------

* Replace `assert np.array_equal` by `np.testing.assert_array_equal` in Mapie unit tests
* Building unit tests for different `Subsample` and `BlockBooststrap` instances
* Change the sign of C_k in the `Kolmogorov-Smirnov` test documentation
* Building a training set with a fraction between 0 and 1 with `n_samples` attribute when using `split` method from `Subsample` class.
Expand Down
6 changes: 4 additions & 2 deletions mapie/tests/test_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,10 @@ def test_results_with_groups() -> None:
# (array([1, 2, 4, 5]), array([0, 3]))]
conformity_scores_0 = np.array([[1.], [0.], [0.], [1.], [1.], [1.]])
conformity_scores_1 = np.array([[1.], [1.], [1.], [1.], [1.], [1.]])
assert np.array_equal(mapie0.conformity_scores_, conformity_scores_0)
assert np.array_equal(mapie1.conformity_scores_, conformity_scores_1)
np.testing.assert_array_equal(mapie0.conformity_scores_,
conformity_scores_0)
np.testing.assert_array_equal(mapie1.conformity_scores_,
conformity_scores_1)


@pytest.mark.parametrize(
Expand Down
6 changes: 4 additions & 2 deletions mapie/tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ def test_results_with_groups() -> None:
y_pred_1 = [15, 10, 5, 15, 10, 5]
conformity_scores_0 = np.abs(y - y_pred_0)
conformity_scores_1 = np.abs(y - y_pred_1)
assert np.array_equal(mapie0.conformity_scores_, conformity_scores_0)
assert np.array_equal(mapie1.conformity_scores_, conformity_scores_1)
np.testing.assert_array_equal(mapie0.conformity_scores_,
conformity_scores_0)
np.testing.assert_array_equal(mapie1.conformity_scores_,
conformity_scores_1)


@pytest.mark.parametrize("strategy", [*STRATEGIES])
Expand Down
Loading