If the behavior of the library has to be changed, a deprecation cycle must be followed to warn users.

A deprecation cycle is not necessary when:

  • adding a new function, or

  • adding a new keyword argument to the end of a function signature, or

  • fixing buggy behavior

A deprecation cycle is necessary for any breaking API change, meaning a change where the function, invoked with the same arguments, would return a different result after the change. This includes:

  • changing the order of arguments or keyword arguments, or

  • adding arguments or keyword arguments to a function, or

  • changing the name of a function, class, method, etc., or

  • moving a function, class, etc. to a different module, or

  • changing the default value of a function’s arguments.

Usually, our policy is to put in place a deprecation cycle over two minor releases (e.g., if a deprecation warning appears in 2.3, then the functionality should be removed in 2.5). For major releases we usually require that all deprecations have at least a 1-release deprecation cycle (e.g., if 3.0 occurs after 2.5, then all removed functionality in 3.0 should be deprecated in 2.5).

Note that these 1- and 2-release deprecation cycles for major and minor releases is not a strict rule and in some cases, the developers can agree on a different procedure upon justification (like when we can’t detect the change, or it involves moving or deleting an entire function for example).


Make sure to review networkx/ after removing deprecated code.

Version 3.0

  • In readwrite/ remove literal_stringizer and related tests.

  • In readwrite/ remove literal_destringizer and related tests.

  • In utils/ remove is_string_like and related tests.

  • In utils/ remove make_str and related tests.

  • In utils/ remove is_iterator.

  • In utils/ remove iterable.

  • In utils/ remove is_list_of_ints.

  • In utils/ remove consume.

  • In utils/ remove default_opener.

  • In utils/ remove empty_generator.

  • Remove utils/ and related tests.

  • In drawing/ remove display_pygraphviz and related tests.

  • In algorithms/ replace chordal_graph_cliques with _chordal_graph_cliques.

  • In algorithms/centrality/ remove betweenness_centrality_source.

  • In algorithms/centrality/ remove edge_betweeness.

  • In algorithms/ remove old name _naive_greedy_modularity_communities.

  • In linalg/ remove _CholeskySolver and related code.

  • In remove to_numpy_matrix and from_numpy_matrix.

  • In readwrite/json_graph/, change function signature for cytoscape_graph and cytoscape_data to replace the attrs keyword. argument with explicit name and ident keyword args.

  • In readwrite/json_graph/, remove attrs kwarg from tree_graph and tree_data.

  • Undo changes related to the removal of pyyaml. Remove the __getattr__ definitions from networkx/, networkx/readwrite/ and networkx/readwrite/ and remove networkx/readwrite/tests/

  • Remove readwrite/ and related tests.

  • Remove readwrite/ and related tests (add info in alternatives).

  • Remove copy method in the coreview Filtered-related classes and related tests.

  • In algorithms/link_analysis/ replace pagerank with pagerank_scipy.

  • In algorithms/link_analysis/ rename pagerank_numpy as _pagerank_numpy.

  • In remove order kwarg from to_pandas_edgelist and docstring

  • Remove readwrite/json_graph/ and related tests.

  • In utils/ remove generate_unique_node and related tests.

  • In algorithms/link_analysis/ remove hub_matrix and authority_matrix

  • In algorithms/link_analysis/, remove hits_numpy and hist_scipy.

  • In classes remove the ordered module and the four Ordered classes defined therein.

  • In utils/ remove preserve_random_state.

  • In algorithms/community/ remove coverage and performance.

  • Remove testing.

  • In linalg/ remove adj_matrix.

  • In algorithms/ replace simrank_similarity with simrank_similarity_numpy.

  • In algorithms/assortativity/ remove numeric_mixing_matrix.

  • In algorithms/assortativity/ remove k_nearest_neighbors.

  • In utils/ remove random_state.

  • In algorithms/operators/ remove name kwarg from union and docstring.

  • In generators/ remove euclidean and tests.

  • In algorithms/node_classification/ remove,, and after moving the functions defined therein into the newly created module, which will replace the current package.

  • In algorithms/link_analysis/, remove the np.asmatrix wrappers on the return values of google_matrix and remove the associated FutureWarning.

  • In remove from_scipy_sparse_matrix and to_scipy_sparse_matrix.

  • In linalg/ remove the FutureWarning, update the return type by removing np.asmatrix, and update the docstring to reflect that the function returns a numpy.ndarray instance.

  • In generators/ remove make_small_graph and make_small_undirected_graph.

  • In remove to_numpy_recarray.

  • In classes/ remove info.