diff --git a/pycrostates/segmentation/tests/test_transitions.py b/pycrostates/segmentation/tests/test_transitions.py index 563fdc9f..ef607feb 100644 --- a/pycrostates/segmentation/tests/test_transitions.py +++ b/pycrostates/segmentation/tests/test_transitions.py @@ -143,17 +143,3 @@ def test_check_labels_n_clusters(): _check_labels_n_clusters(np.random.randint(0, 5, size=100).astype(float), 5) with pytest.raises(ValueError, match=re.escape("'[6 7]' are invalid")): _check_labels_n_clusters(np.random.randint(0, 8, size=100), 6) - - -def test_deprecated_ignore_self(): - labels = np.random.randint(0, 5, size=100) - - with pytest.warns(DeprecationWarning, match="is deprecated and will be removed"): - M = compute_transition_matrix(labels, 5, ignore_self=True) - M_ = compute_transition_matrix(labels, 5, ignore_repetitions=True) - assert_allclose(M, M_) - - with pytest.warns(DeprecationWarning, match="is deprecated and will be removed"): - M = compute_expected_transition_matrix(labels, 5, ignore_self=True) - M_ = compute_expected_transition_matrix(labels, 5, ignore_repetitions=True) - assert_allclose(M, M_) diff --git a/pycrostates/utils/_fixes.py b/pycrostates/utils/_fixes.py index f5bd5635..579aebce 100644 --- a/pycrostates/utils/_fixes.py +++ b/pycrostates/utils/_fixes.py @@ -1,7 +1,6 @@ """Temporary bug-fixes awaiting an upstream fix.""" import sys -from warnings import warn # https://github.com/sphinx-gallery/sphinx-gallery/issues/1112 @@ -19,13 +18,3 @@ def __getattr__(self, name): # noqa: D105 return getattr(sys.stdout, name) else: raise AttributeError(f"'file' object has not attribute '{name}'") - - -def deprecate(old: str, new: str) -> None: - """Warn about deprecation of an argument.""" - warn( - f"The '{old}' argument is deprecated and will be removed in future " - f"versions. Please use '{new}' instead.", - DeprecationWarning, - stacklevel=2, - )