summaryrefslogtreecommitdiff
path: root/networkx/algorithms/connectivity/tests
Commit message (Collapse)AuthorAgeFilesLines
* Lint using Ruff (#6371)danieleades2023-02-194-15/+15
| | | | | | | | | | | | | | | * lint and fix using ruff * add flake8-pie lints * remove useless import alias * bump version * bump deps --------- Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
* Remove deprecated function nx.info (#5759)Mridul Seth2022-06-211-1/+0
| | | | | | | | | | * Remove deprecated function nx.info * remove functions from TOC * replace print(nx.info(G)) with print(G) in example Co-authored-by: Dan Schult <dschult@colgate.edu> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Use isort with pre-commit to enforce import guidelines (#5659)Mridul Seth2022-06-027-15/+24
| | | | | * Add isort to pre-commit * Run isort on all python files (except __init__.py ones)
* Remove redundant py2 numeric conversions (#5661)Mridul Seth2022-05-311-1/+1
| | | | | | | | | * Remove redundant float conversion * Remove redundant int conversion * Use integer division Co-authored-by: Miroslav Šedivý <6774676+eumiro@users.noreply.github.com>
* doc: fix typos in docstring and comment (#5647)danielolsen2022-05-161-1/+1
|
* Drop Py37 (#5143)Jarrod Millman2021-10-231-1/+1
| | | | | | | | | | | | | | | | | | | * Drop Py37 * XML serialization issue * Use math.comb Co-authored-by: Simone Gasperini <simone.gasperini2@studio.unibo.it> * Run pyupgrade --py38-plus * Run black * More documentation * Deprecate euclidean Co-authored-by: Simone Gasperini <simone.gasperini2@studio.unibo.it>
* Remove decorator dependency (#4739)Kelly Boothby2021-06-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * added argmap decorator * removed most dependency on decorator * removed last reference to decorator? * Made the compilation of argmap-decorated functions lazy to reduce import time. * black * reworked try_finally to make cleanup cleaner * first pass at documentation; general cleanup * incorporated dschult's comments * rest formatted docstrings * added unit tests and fixed a few bugs that cropped up * Apply suggestions from code review Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Dan Schult <dschult@colgate.edu> * Exapnd docstrings for decorators.py * * refactored try_finally into a keyword-only argument * more tweaks to documentation re: @stefanv's comments * additional unit test for signature-clobbering decorators * spellcheck my txt and expand new test to help me grok it * rehash docstrings for sphinx * rewrite docs to provide some examples where argmap used without @argmap * doc tweak * last touches * documentation clarifications * run black * doc review * remove decorator module from github workflows and INSTALL.rst * add text to release_dev to describe highlights and improvements here Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Dan Schult <dschult@colgate.edu>
* DOC: Fix links, use DOI links, wayback machine where required (#4868)Mridul Seth2021-06-082-3/+3
| | | | | | | | | | | * Fix links, use DOI links, wayback machine where required * Add nx-guides to intersphinx mapping. * Replace external mpl link w/ intersphinx. * Update mpl intersphinx mapping. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update black (#4814)Jarrod Millman2021-05-182-3/+3
|
* DOC: Remove repeated words (#4410)Miroslav Šedivý2020-12-021-1/+1
|
* Format python in docstrings (#4168)Jarrod Millman2020-08-193-19/+4
| | | | | | | | | | | | | | | | | | | * Format code w/ black * Format docstrings w/ black * Manual cleanup * Tell pytest to ignore planned deprecations * Don't call plt.show during testing * Another known deprecation * DOC: rm duplicate line from docstring example * Minor cleanup Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Format w/ blackJarrod Millman2020-07-106-234/+319
|
* Added fix for issue #3846 (#3848)Dan Schult2020-03-041-1/+1
| | | Fixes #3846
* Update string formatJarrod Millman2020-01-014-73/+84
| | | | | | | | | find -name "*py" | xargs grep -n '" % ' find -name "*py" | xargs grep -n '"\.format(' find -name "*py" | xargs grep -n "' %" find -name "*py" | xargs grep -n 'msg % ' find -name "*py" | xargs grep -n ' %d ' find -name "*py" | xargs grep -n '\.format('
* Upgrade to Py36 syntaxJarrod Millman2020-01-014-18/+18
| | | | find networkx -name \*.py -exec pyupgrade --py36-plus {} \;
* Convert %-format to fstringJarrod Millman2020-01-012-2/+2
|
* Improve test coverageJarrod Millman2019-12-311-45/+63
|
* Refactor testsJarrod Millman2019-11-192-0/+5
|
* Update styleJarrod Millman2019-11-192-104/+141
|
* Remove superfluous encoding informationJarrod Millman2019-11-112-2/+0
|
* Remove boiler plate from top of modulesJarrod Millman2019-11-111-8/+0
| | | | | | | | | The copyright and author stuff is not necessary, out-of-date, and inconsistent. It takes up visual space and is a pain to police everyone doing the same thing on the top of the module. Git handles authorship in a comprehensive and authoritative way. The LICENSE.txt file applies to all project code.
* PEP8 fixes to testsJarrod Millman2019-10-183-10/+11
|
* Replace eq_, ok_ with assertJarrod Millman2019-10-121-6/+5
|
* Replace nose.raises with pytest.raises context managerJarrod Millman2019-10-122-50/+50
|
* Replace nose.assert_raises with pytest.raisesJarrod Millman2019-10-126-56/+53
|
* tracking down use of deprecated functionsDan Schult2019-10-121-1/+2
|
* Remove unused importsJarrod Millman2019-10-125-5/+5
|
* Convert nose.tools.assert_* functions into assertsJarrod Millman2019-10-128-348/+255
|
* Use class methods for class setup/teardownStefan van der Walt2019-10-121-13/+14
|
* First round of pytest fixesStefan van der Walt2019-10-121-0/+0
|
* Make tests deterministic in connectivity/ (#3220)Dan Schult2018-11-044-17/+17
|
* Speed up kcut and kcomponent tests (#3108)Dan Schult2018-08-012-44/+34
|
* Fix bugs in all_node_cuts, address #3025 (#3039)Haochen Wu2018-07-241-5/+12
| | | | | | | | | | | | | | | * temp sol * Fix implementation in all_node_cuts * Remove redundant check * Add back tests for alternative flow. * Speed optimization * Test more cuts Fixes #3025
* Unify random state treatment across package (#3058)Dan Schult2018-07-162-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #1764 * Add a doc page to explain random number generator handling * replace deprecated numpy.random.random_integers with randint * First set of random_state decorator updates... utils and some generators * protect numpy import from failure is not there * fix doctests in randomness.rst * Update algorithms for new random_state paradigm * Fix tests dependent on python version * Update random_state paradigm in rest of the modules * fix tests for wierd cases. windows 32bit doesn't like big seeds. smallworld wasn't sending seed to utils.discrete_sequence * Add tests. Rewrite randomstate interface class to fix tests * anogther tweak for osx with no deps * improve doc examples for seed. Check all functions for seed independence. Calling with int seed should not affect global RNG * Add testing script and add more variates to RandomInterface * fix typo and remove unneeded file causing nodetest trouble * fix doctest for randomness.rst
* Deleted tests that were hidden due to name clash. (#2867)Mads Jensen2018-02-171-1/+1
|
* Misc. typos (#2872)luzpaz2018-02-142-4/+4
| | | | | | | | | | Found via `codespell -q 3 -I ../networkx-whitelist.txt` where whitelist consisted of: ``` ans childs iff nd te ```
* Pep8 fixesJarrod Millman2018-01-206-53/+102
|
* Remove automatic processing of G.name attribute (#2829)Dan Schult2018-01-142-6/+0
| | | | | | It's too hard to keep G.name consistently updated throughout the codebase. Let users do it. This stops from deprecating G.name altogether, but it is a first step toward that if we decide to go that route.
* Add flow based node and edge disjoint paths. (#2063)Jordi Torrents2017-11-271-0/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add flow based node and edge dijoint paths. This is a flow based implementation of edge and node disjoint paths. We compute the maximum flow between source and target on an auxiliary directed network. This auxiliary network is the same used in the flow based edge and node connectivity algorithms. See `networkx.algorithms.connectivity.utils` for details. The saturated edges in the residual network after running the maximum flow algorithm correspond to edge or node disjoint paths between source and target in the original network. The user can specify the maximum number of paths to yield, but we also take advantatge of the fact the number of disjoint paths is bounded by the degree of source and target to speed up the computation, especially in sparse graphs. This function handles both directed and undirected graphs, and can use all flow algorithms from NetworkX flow package. This PR supersedes #2053. * Fix documentation for disjoint_paths.py
* Dictionary comprehensions from #1700 merged conflicts (#2768)Dan Schult2017-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * use dict comprehensions in kcomponents.py * use dict comprehensions in test_kcomponents * use dict comprehensions in test_kcutsets * use dict comprehensions in test_maxflow * use dict comprehensions in test_maxflow_large_graph * use dict comprehensions in flow/utils.py * use dict comprehensions in weighted.py * use dict comprehensions in graphml.py * use dict comprehensions in nx_pylab.py * use dict comprehensions in relabel.py * use dict comprehensions in assortavity/mixing.py * conform to pep8 guidelines in mixing.py * Minor tweaks to kcomponents to update to v2.0
* Added function for finding a k-edge-augmentation (#2572)Jon Crall2017-10-021-0/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit for edge_augmentation enhancement * Added is_k_edge_connected * getting tests to run without syntax errors * Added argmin to utils and updated weighted bridge aug to actually use weights * Found error in weighted bridges * Fixed serious bug in weighted bridge augmentation * module cleanup * more consise implementation of 1-edge-aug * removed alternative implementations of one edge aug * Fixed bugs in unconstrained bridge augmentation. Added tests for feasibility and optimality. Doctests and nosetests all pass * Removed debugging code * Actually removed debugging code * Reworked randomized algorithm into a real greedy algorithm based on weights * added better algorithm for finding a partial augmentation * fixed doc. Also rebased onto master * removed test code * Added whatsnew and documentation * used tiebreaker weights when avail is not given to greedy algo * comments * removed old param and passed partial to k=1 * Fixed test failures on python2 * test fixes for 3.6. removed old comment * debugging 3.6 failure * Using new LCA algorithm. Fixed subgraph errors. Attempt to make edge ordering more sane and aggreable with Khullers notation * minor line-break rearrangement for one exception message * Added and improved docs in edge_augmentation * quick fix for consistency * another minor fix * removed commented code: :
* Removed unused imports (#2653)James Lamb2017-10-012-2/+1
|
* Fix links (#2663)Jarrod Millman2017-09-111-1/+1
| | | | | | * Fix links * Comply with pep8
* Simplify base classes. (#2604)Dan Schult2017-08-123-4/+4
| | | | | | | | | | * 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.
* [ENH] Added functions for k-edge-connected components/subgraphs (#2554)Jon Crall2017-08-081-0/+513
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit of k-edge-ccs and subgraphs Added implementation of k-edge-ccs Added implementation of k-edge-subgraphs Added tests for both local-cc and subgraph versions. Added assert to test to verify their difference. * imported appropriate utils and switched to random_powerlaw_tree_sequence * Sped up tests. Added new directed and five clique test case * Fixed docstrings and __init__ Added SeeAlso docstring and added algorithms to toplevel __init__ Fixed author and cleaned docstrings. Removed profiling code. Fixed spelling error. Registerd module for doc autogeneration. Updated bridges.py docstring. * Fixed doctest section underlines * removed test main * Added workaround for classmethod notimplemented and tests * Fixed k=1 case for directed graphs and increased coverage
* Some changes to reduce the really long parts of tests (#2561)Dan Schult2017-08-022-4/+6
| | | | | | | | * adjust some of the slowest tests. minor speedup of is_connected. * Add adj property to AntiGraph class in kcomponents.py * Add comment to explain why test loop only goes once
* Comply with pep8Jarrod Millman2017-07-252-81/+95
|
* Use random_powerlaw_tree_sequence instead of powerlaw_sequenceJarrod Millman2017-07-252-2/+2
|
* Remove blockmodel deprecated in 2015Jarrod Millman2017-07-251-1/+1
| | | | See PR #1886 and 9b7194788.
* Remove create_degree_sequence deprecated in 2013Jarrod Millman2017-07-252-3/+3
| | | | See a02b65560.