| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
| |
* Add isort to pre-commit
* Run isort on all python files (except __init__.py ones)
|
| |
|
|
|
|
|
|
|
| |
* added examples
* Update networkx/algorithms/components/connected.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| | |
|
| |
|
| |
Co-authored-by: rbusche <rbusche@inserve.de>
|
| |
|
|
|
|
|
|
|
| |
* added test for issue 3823
* fixed (networkx #3823)
* minor performance tweak
* pep8
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* Fixed problem in documentation view of this function
* Replacing `Return` to `Returns` in function docs
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* Deprecate component_subgraphs functions
Resolves #1431
* Fix antigraph error introduced in connected_components
* Add tests of null graph to component functions and avoid lists when counting
|
| |
|
| |
algorithms/components/connected.py was littered with incorrect descriptions that we raise NetworkXNotImplemented for undirected graphs, when we meant to say directed.
|
| |
|
|
|
|
|
|
| |
* 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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
As of the date of this commit, there is no way to get an arbitrary
element of an iterable like a set without modifying it (for example, as
in `set.pop()`). The `peek()` function is more readable than writing
next(iter(S))
whenever an arbitrary element of an iterable is required.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make connected_components a generator of sets of nodes, it was a generator
of list of nodes. See #1501 for discussion.
Use a plain BFS to compute them instead of using the single source
shortest path function. The latter also does a BFS but keeps track of the
distances. This is only slightly faster for small graphs (arround 5% in my
tests), but for larger graphs the speed up is more relevant (around 1.8x
faster). Also I think it's conceptually better. As @ysitu said, we have a
tendency to abuse shortest paths functions for reachability.
Also improved biconnected components examples, docstrings, and code.
|
| | |
|
| |
|
| |
The docstring of connected_component_subgraphs() had one parameter (copy=True) listed as a Return.
|
| |
|
|
| |
Addresses #964
|
| | |
|
| |
|
|
|
| |
Add option to copy (or not) subgraph data.
Rework connected components algorithms as generators.
|
| |
|
|
| |
This could still use review.
|
| | |
|
| |
|
|
| |
Addresses #457
|
| | |
|
| |
|
|
|
| |
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401874
|
| |
|
|
|
| |
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401832
|
| |
|
|
|
|
|
|
| |
so we don't need nose test plugin to handle doctest
strings in modules.
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401706
|
|
|
--HG--
extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401697
|