summaryrefslogtreecommitdiff
path: root/networkx/algorithms/cuts.py
Commit message (Collapse)AuthorAgeFilesLines
* plugin based backend infrastructure to use multiple computation backends (#6000)Mridul Seth2022-11-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Wrappers classes to dispatch to a backend * Rework the backend dispatching - Use __networkx_plugin__=name to find graph-like objects instead of subclassing - Add PluginInfo to smooth over differences in importlib.metadata across python versions - Add dispatch behavior override via environment variable to aid in testing plugins * Dispatch more algorithms and improve auto-test capabilities * Allow dispatcher decorator without a name - Name is taken from the decorated function - Raise error if backend doesn't implement a decorated function which is called - Check for duplicate names for dispatching algorithms * Make sphinx pick up backend docs * make black happy * Rename decorator to _dispatch as it's experimental * A few more dispatched functions * Make convert to and from methods for auto-testing - Rename `convert` to `convert_from_nx` - Add `convert_to_nx` function These will allow backends to return native objects when dispatching, but provide a mechanism to convert the result to the type expected by NetworkX tests for the auto-test plugin mechanism. * More dispatching * Include name with `convert_**_nx` methods * Remove known plugin names This check is not needed, as any plugin can register itself in the entry points section. The dispatching and auto-testing explicitly specify the plugin to use, so there is no need to hardcode the options. These were originally included for security, but any malicious actor would simply use one of the valid names, so having a hardcoded list does not actually provide any meaningful security. * Add `dispatchname` to dispatchable functions Co-authored-by: Jim Kitchen <jim22k@gmail.com> Co-authored-by: Erik Welch <erik.n.welch@gmail.com>
* Improve code coverage for cuts.py (#4473)cpurmessur2020-12-221-26/+26
| | | | | | | | | * Improve code coverage of cuts * update tests for cuts * update doc string description * update conciseness in tests
* Format python in docstrings (#4168)Jarrod Millman2020-08-191-3/+3
| | | | | | | | | | | | | | | | | | | * 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>
* Docs update (#4161)Dan Schult2020-08-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixes #3955 (boundary_expansion docs) * add to docs for steiner_tree * Add missing functions to docs. Thanks to #4111 * Doc fixups * Put filters onto the doc pages. * Add @jamestrimble doc compare script to repo and expand * Fix latex syntax in docs for trophic * more latex corrections * deprecate edge_betweeness and betweeness_centrality_source. warnings and add to list of deprecations * Use docs to identify hopcrfot_karo_matching and maximum_matching * remove underscore from _naive_greedy_modularity_communities * cite James Trimble for code that finds missing functions * Update parallel_betweenness example to avoid deprecated function betweenness_centrality_source should be replaced by betweenness_centrality_subset in plot_parallel_betweenness. find _naive_greedy and change name * tweak
* Format w/ blackJarrod Millman2020-07-101-3/+11
|
* Remove superfluous encoding informationJarrod Millman2019-11-111-1/+0
|
* Remove boiler plate from top of modulesJarrod Millman2019-11-111-10/+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.
* Remove future imports needed by Py2Jarrod Millman2019-09-181-1/+0
|
* link DOIs to preferred resolver (#2879)Katrin Leinweber2018-02-231-3/+3
|
* Change default role for sphinx to 'obj'Dan Schult2016-03-031-27/+27
| | | | | | | | Change double `` to single ` for all function arguments. Remove double `` around True, False, None Leave double `` when a literal python expression is intended. I found a couple of places where math mode was intended. Still need to look for those.
* Fix sphinx autosummary doc generation errors.Dan Schult2016-03-031-7/+7
| | | | Some modules moved or were removed. A few indentation issues.
* Update community/quality to use quotient_graph instead of blockmodelMridul Seth2015-12-291-0/+1
|
* Adds functions for measuring cuts.Jeffrey Finkelstein2015-11-111-0/+395
Adds a new module, `networkx.algorithms.cuts`, containing functions that compute the various measures of efficiency for cuts, including cut size, volume, and expansion, among others. In doing so, this commit also updates `networkx.algorithms.boundary` to accommodate multigraphs and directed graphs.