Skip to content

Commit

Permalink
rm deprecation test function
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Nov 8, 2023
1 parent 78304ec commit 3c72e6f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
14 changes: 0 additions & 14 deletions pycrostates/segmentation/tests/test_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
11 changes: 0 additions & 11 deletions pycrostates/utils/_fixes.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
)

0 comments on commit 3c72e6f

Please sign in to comment.