| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
* Ignore weakrefs when testing for memory leak
* Add educational comments about gc and weakrefs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #6036
* test load centrality
* test dispersion
* test dispersion
* dispersion test
* test dispersion
* bug-fixes-for-issue-6088
* deleted
* bug-fix-for-issue-6092
* bugfix-for-issue-6088
* bugfix-for-issue-6088
* bugfix-for-issue-6088
* bugfix-for-issue-6102
* bugfix-for-issue-6102
* bugfix-for-issue-6102
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Automate reset of cache for _adj,_pred,_succ
* Make G._adj a data descriptor that resets G.adj when needed.
* update places in the code where both G._succ and G._adj are changed
This is no longer needed since G._succ and G._adj are synced during __set__
* testing hasattr(G, `_adj`) no longer ensures an instance.
* Make mypy happy
* Switch to hardcode attribute names in the data descriptors
* Improve doc_strings for the data descriptors
|
| |
|
|
|
| |
* Add isort to pre-commit
* Run isort on all python files (except __init__.py ones)
|
| |
|
|
| |
* Make all graph properties cached properties
* one test function is not needed due to test inheritance
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* Fixed the issue that the wrong dict factory on a MultiDiGraph was used for edge attributes (edge_key_dict_factory instead of edge_attr_dict_factory)
Extended tests to typecheck the dict factories and added a test that incorporates custom dict factories on a MultiDiGraph
* Mypy ignore inferred types in MDG subclass.
Co-authored-by: Fabian Ball <fabian@codagio.de>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
| |
* fix error in the tests... now original code fails test
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
|
|
|
| |
* Raise ValueError if None is added as a node.
Removed some tests that checked that errors raised when None was a node.
* update tutorial to make a stronger statement about None
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add special processing of `multigraph_input` upon graph init
Fixes: #4720
Adding a keyword argument `multigraph_input=True`
to a graph construction call should treat any incoming input data for
the graph as a dict-of-dict-of-dict multigraph data structure.
Previously the multigraph_input argument would be added to the graph
attribute dict and ignored when processing the input data.
* Change default and add tests
* make default try mgi=True, and if fails try mgi=False
* copy parameter docstring to main class
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Refactor testing utilities
Change `assert_edges_equal`, `assert_graphs_equal`, and `assert_nodes_equal`
to be more pytest-idiomatic.
For example, `assert_edges_equal` becomes the Boolean function `edges_equal`
and then the assert is done the testing file
(i.e., `assert edges_equal(edges1, edges2)`).
This also makes these utility functions useful in nontesting situations
where you want to compare edges, but not raise an exception based on the result.
* Move testing utility functions
* Use new testing utilities
* Deprecate assert_*_equal testing utilities
* Document node, edge, and graph equality helper functions
* text nits.
* Update networkx/tests/test_convert_pandas.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/readwrite/tests/test_sparse6.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/readwrite/tests/test_graph6.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/generators/tests/test_classic.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tree/tests/test_operations.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tree/tests/test_coding.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tests/test_dag.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/minors/tests/test_contraction.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* add short equality description to docstring
* Suppress known warnings
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| | |
|
| |
|
|
|
| |
* Skip memory leak test for PyPy
* add reason code for skipif
|
| |
|
| |
Refactor exception handling and improve test specificity.
|
| |
|
|
|
|
|
|
|
|
| |
* Modify graph __str__ to return nx.info.
Returns the result of nx.info(self) instead of only the
instance name.
* TST: Modify tests for new str dunder.
* MAINT: move graph summary to __str__ from info
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat: `clear_edges` in `networkx.Graph`
Method to clear all edges in a graph without altering nodes
or graph attributes. Added corresponding test too.
* tests: improve `test_clear` in `TestGraph`
Added a graph attribute before clearing to test its proper deletion.
too.
* tests: add tests for `clear` and `clear_edges` specific to DiGraph
To test that DiGraph-specific edge records are cleared as well.
* fix: specific `clear_edges` for `DiGraph`
So that DiGraph's pred/succ also get cleared.
* Convert docstrings tests and docs reference links to add clear_edges
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
| |
find networkx -name \*.py -exec pyupgrade --py36-plus {} \;
|
| |
|
|
|
|
|
|
| |
* Enable ThinGraph tests
* Rewrite test_special to make ThinGraph tested
* fix pycodestyle for test_digraph.py
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Note that pytest does not seem to inspect the stacktrace for multiple
exceptions raised and caught, so I only checked the "outer" exception.
Class setup had to be replaced with method setup: graphs get modified,
so we need a fresh one for each method.
|
| | |
|
| |
|
| |
Part of #1393
|
| |
|
|
|
|
|
|
| |
* Remove a second cyclic reference in G.root_graph
Related to #3011 and #2885 and maybe #2793
* Add tests for memory leaks due to copy()
|
| |
|
|
|
|
| |
Graphs no longer have references to views.
Views still have references to the graph.
This should ease subclassing the base graph classes
because you don't have to worry about creating memory leaks.
|
| |
|
|
|
|
|
| |
I didn't change functions defined in tests.
I also left drawing routines as is at least for now.
Addresses #1582
Fixes #1583
|
| | |
|
| |
|
|
|
| |
This eases creating code that works for both v1 and v2.
It doesn't address the concerns of #2634 but it eases
the transition to v2.
|
| |
|
| |
Fix #2630.
|
| |
|
|
|
|
|
|
|
|
| |
* move selfloop methods out of graph classes into function.py
* replace G.node with G.nodes. fix Pickle of views
* Replace G.edge with G.edges
* Add a few lines of docs for release realted to this PR.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update code to prepare for melding graphviews
* Meld graphviews into graph classes
* Cleanup subgraph calling sign. and remove duplicate code
* Add some tests for raising exceptions
* update edge_kcomponents to avoid readonly views.
* Add root_graph attribute and tests
Update tests for root_graph as well as fresh_copy.
I left fresh_copy as an attribute even with root_graph
because a view might switch the data structure of the
view from directed to undirected. Going to the root_graph.__class__
may not give you what you need to create a graph like the view.
Fresh_copy gives a null graph with the directed/multi type of that
view or graph.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add minimal docstrings
* Add note about ordered graph variants
* Mention ordered variant in `See Also` section
* Comply with pep8
* Replace reference to LogGraph with PrintGraph
LogGraph was a reference to a graph that logged each mutation.
That's what PrintGraph does and is provided in the examples directory.
* Do not claim OrderedGraphs maintain the order of adding edges
* Remove OrderedGraph examples and minor cleanup for Sphinx
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#2475)
* Dont assume iterators for nodes/edges/degrees (prep for views)
* Add graph view classes for nodes/edges/degree
* Add right set operations (not present in python3.3 KeysView
* Add nodes before adding edges so python36 tests work
By only adding edges, the nodes were added in order (0,1,3,2)
and with the ordered nature of python3.6 dicts the tests failed.
Could also fix by using nodelist on each call to to_convert_...
* weighted graph convert tests testing empty graphs
The edge iterator was exhausted for source before being used for dest
* allow DegreeView to include case of nbunch
* Make node/edge/degree properties of Graph
* View contains fix and Viewers can return self. More tests
* Add more tests including one for #2347
* Add nbunch tests and pep8
* Rename to EdgeView and EdgeDataView
* docs tweaks and pep8
* fix up nodeDataView contains. Add and clean up tests.
* Change the graph attributes to read-only properties
* Reframe views code and extend _node to all networkx (still need
examples)
* Clean up and pep8 for view changes
* ername AtlasViews, simplify code and add docstrings
* Make G[u] return a view, and catch some doc bugs
* Update views to use _node,_adj. Add len to EdgeDataView
* minor adjustments to example subclass/printgraph
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Dont assume iterators for nodes/edges/degrees (prep for views)
* Add graph view classes for nodes/edges/degree
* Add right set operations (not present in python3.3 KeysView
* Add nodes before adding edges so python36 tests work
By only adding edges, the nodes were added in order (0,1,3,2)
and with the ordered nature of python3.6 dicts the tests failed.
Could also fix by using nodelist on each call to to_convert_...
* weighted graph convert tests testing empty graphs
The edge iterator was exhausted for source before being used for dest
* allow DegreeView to include case of nbunch
* Make node/edge/degree properties of Graph
* View contains fix and Viewers can return self. More tests
* Add more tests including one for #2347
* Add nbunch tests and pep8
* Rename to EdgeView and EdgeDataView
* docs tweaks and pep8
* fix up nodeDataView contains. Add and clean up tests.
* Tweaks to improve speed for nodes and edges.
* improve views dependence on ABCs, remove len from dataviews
* First pass on docs in views.py
* Change property to lazy attribute
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Doing this invalidated the test in test_graph.py
(test_attr_dict_not_dict), so I removed the test entirely.
|
| |
|
|
|
|
|
| |
In doing so, I found a few attr_dict assignments I missed, and cleaned
up in a few spots. I also made sure to use the update method rather than
keyword assignment in json_graph/adjacency.py to allow for some (likely
VERY corner) cases where edge and node attributes might not be strings.
|
| |
|
|
|
|
|
|
| |
I also went through and modified all attr_dict references to either
directly assign keywords to node/edge attributes, or use the ** syntax
to unpack the dictionaries. The only case of these I couldn't do is
networkx.convert.py -- largely because I don't understand how multigraph
edges work.
|
| |
|
|
|
|
| |
Combing through the code for any point where it pushes a dictionary to
the add_node method rather than keywords; augmenting these arguments
with ** to turn them into keyword arguments.
|
| |
|
|
|
|
|
|
| |
The same mutation (attr_dict mutations) that occurred in add_node
occurred in the add_edges and add_edges_from methods; also, the same
test failure (passing an empty sequence shouldn't really raise an error,
since you can update a dictionary with an empty sequence without raising
an error).
|
| |
|
|
|
|
|
|
|
| |
Graph.add_node mutated the attr_dict parameter and assigned it directly
to the graph's node dictionary, creating potential for unexpected
behavior. Creating a new dictionary based on the supplied attr_dict (and
updated with the supplied kwargs) avoids this problem -- also had to
update the test for adding nodes, since sending an empty sequence no
longer raises an error (which seems reasonable).
|