summaryrefslogtreecommitdiff
path: root/networkx/utils
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2021-05-20 11:16:09 -0700
committerGitHub <noreply@github.com>2021-05-20 11:16:09 -0700
commitb71df0db8729e2f24965bb15ced0d580390de99e (patch)
tree971b139b30115ae8fda88b56927590ed27bd88f0 /networkx/utils
parentdebfe114314f0829dbf3d0d9b489172c8c60bed0 (diff)
downloadnetworkx-b71df0db8729e2f24965bb15ced0d580390de99e.tar.gz
Deprecate preserve_random_state (#4826)
Diffstat (limited to 'networkx/utils')
-rw-r--r--networkx/utils/decorators.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/networkx/utils/decorators.py b/networkx/utils/decorators.py
index c1b61f33..8ab0a4d2 100644
--- a/networkx/utils/decorators.py
+++ b/networkx/utils/decorators.py
@@ -2,6 +2,7 @@ from collections import defaultdict
from os.path import splitext
from contextlib import contextmanager
from pathlib import Path
+import warnings
import networkx as nx
from decorator import decorator
@@ -331,6 +332,9 @@ def preserve_random_state(func):
-----
If numpy.random is not importable, the state is not saved or restored.
"""
+ msg = "preserve_random_state is deprecated and will be removed in 3.0."
+ warnings.warn(msg, DeprecationWarning)
+
try:
import numpy as np