diff options
author | Mridul Seth <seth.mridul@gmail.com> | 2022-06-16 13:45:03 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 12:45:03 +0300 |
commit | b4397e368258cf1a33e7dedee8ede116878ffdac (patch) | |
tree | 4459c6a154b9a732b3879483d5592a7c35c2a97e /networkx/utils | |
parent | 066ade5d2de8ba564366cc8055899d6b559aff56 (diff) | |
download | networkx-b4397e368258cf1a33e7dedee8ede116878ffdac.tar.gz |
Remove deprecated functions dict_to_numpy_array2 and dict_to_numpy_array1 (#5756)
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
Diffstat (limited to 'networkx/utils')
-rw-r--r-- | networkx/utils/misc.py | 36 | ||||
-rw-r--r-- | networkx/utils/tests/test_misc.py | 10 |
2 files changed, 0 insertions, 46 deletions
diff --git a/networkx/utils/misc.py b/networkx/utils/misc.py index 271c1442..591542c1 100644 --- a/networkx/utils/misc.py +++ b/networkx/utils/misc.py @@ -29,8 +29,6 @@ __all__ = [ "generate_unique_node", "default_opener", "dict_to_numpy_array", - "dict_to_numpy_array1", - "dict_to_numpy_array2", "arbitrary_element", "pairwise", "groups", @@ -172,23 +170,6 @@ def dict_to_numpy_array(d, mapping=None): return _dict_to_numpy_array1(d, mapping) -def dict_to_numpy_array2(d, mapping=None): - """Convert a dict of dicts to a 2d numpy array with optional mapping. - - .. deprecated:: 2.8 - - dict_to_numpy_array2 is deprecated and will be removed in networkx 3.0. - Use `dict_to_numpy_array` instead. - """ - msg = ( - "dict_to_numpy_array2 is deprecated and will be removed in networkx 3.0.\n" - "Use dict_to_numpy_array instead." - ) - warnings.warn(msg, DeprecationWarning, stacklevel=2) - - return _dict_to_numpy_array2(d, mapping) - - def _dict_to_numpy_array2(d, mapping=None): """Convert a dictionary of dictionaries to a 2d numpy array with optional mapping. @@ -210,23 +191,6 @@ def _dict_to_numpy_array2(d, mapping=None): return a -def dict_to_numpy_array1(d, mapping=None): - """Convert a dict of numbers to a 1d numpy array with optional mapping. - - .. deprecated:: 2.8 - - dict_to_numpy_array1 is deprecated and will be removed in networkx 3.0. - Use dict_to_numpy_array instead. - """ - msg = ( - "dict_to_numpy_array1 is deprecated and will be removed in networkx 3.0.\n" - "Use dict_to_numpy_array instead." - ) - warnings.warn(msg, DeprecationWarning, stacklevel=2) - - return _dict_to_numpy_array1(d, mapping) - - def _dict_to_numpy_array1(d, mapping=None): """Convert a dictionary of numbers to a 1d numpy array with optional mapping.""" if mapping is None: diff --git a/networkx/utils/tests/test_misc.py b/networkx/utils/tests/test_misc.py index 23664ef4..94f11228 100644 --- a/networkx/utils/tests/test_misc.py +++ b/networkx/utils/tests/test_misc.py @@ -270,13 +270,3 @@ def test_arbitrary_element_raises(iterator): """Value error is raised when input is an iterator.""" with pytest.raises(ValueError, match="from an iterator"): arbitrary_element(iterator) - - -def test_dict_to_numpy_array_deprecations(): - np = pytest.importorskip("numpy") - d = {"a": 1} - with pytest.deprecated_call(): - nx.utils.dict_to_numpy_array1(d) - d2 = {"a": {"b": 2}} - with pytest.deprecated_call(): - nx.utils.dict_to_numpy_array2(d2) |