summaryrefslogtreecommitdiff
path: root/networkx/classes/graphviews.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in the networkx codebase (#6335)Anurag Bhat2023-01-051-1/+1
| | | | | * Fix_Typos * Commit_Suggestions
* Attempt to reverse slowdown from hasattr needed for cached_property (#5836)Dan Schult2022-07-161-4/+4
| | | | | | | | | | | | | | | | | * 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
* Use isort with pre-commit to enforce import guidelines (#5659)Mridul Seth2022-06-021-5/+4
| | | | | * Add isort to pre-commit * Run isort on all python files (except __init__.py ones)
* Add Mypy type checking infrastructure (#5127)Ross Barnowski2021-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add minimal mypy configuration file. * Add mypy workflow to GH. * Properly import sentinels from traversal.edgedfs. * mypy doesn't like variables named \"e\". * Rm annotations from single function. * Fix name collisions in test suite. Make sure all tests have unique names. * Rm unused random seed in test setup. * Rm redundant __all__ specification. * Silence mypy error from sum(). Mypy bug? * Fix tsp test instantiation nit. * \"type: ignore\" to suppress conditional fn sigature errors. * Remaining \"type: ignore\" to appease mypy. * Configure mypy to ignore inheritance issues. * Update exclude conf for CI. - Add yaml - Reformat regex containing reportviews * Rm partial annotations from lukes.py. Fixes mypy errors due to unannotated code. * Reorg defaultdict to reduce type: ignore cruft. * Homogenize signatures for fns defined in conditionals. * err as varname only in exception catching. * Fix name collision in Bellman-Ford test suite.
* Format w/ black==20.8b1Jarrod Millman2020-10-061-2/+2
|
* Format python in docstrings (#4168)Jarrod Millman2020-08-191-15/+5
| | | | | | | | | | | | | | | | | | | * 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>
* Remove unnecessary nx imports from doctests (#4163)Jarrod Millman2020-08-161-2/+0
| | | Co-authored-by: Dan Schult <dschult@colgate.edu>
* Format w/ blackJarrod Millman2020-07-101-6/+15
|
* improve docs for subgraph_view filter_egde (#4010)anentropic2020-06-191-5/+7
| | | Fixes #4003
* 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 deprecated weakly_connected_component_subgraphsJarrod Millman2019-10-121-2/+0
|
* Fix subgraph_view testingDan Schult2019-10-121-6/+1
|
* Remove deprecated functions and methods. add to release notes.Dan Schult2019-10-121-53/+0
|
* Document subgraph_view (#3627)Anton Lodder2019-10-081-4/+108
| | | Fixes #3625
* Update copyrightJarrod Millman2019-03-301-1/+1
|
* Update docs with all functions left out of rst files (#3091)Dan Schult2018-07-271-1/+1
| | | | | | | | * Update docs with all functions not added to rst files Also add script to find these functions * put back removed periods after references
* Simplify the Graphview and SubGraphView system (#3073)Dan Schult2018-07-201-166/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Simplify the Graphview and SubGraphView system - add tests to show that extensions of base graph classes (only add new functions) should be able to use the Graph.subgraph and Graph.copy methods easily - Remove ReadOnlyGraph class in favor of existing freeze() function - Switch all GraphView classes to generic_graph_view function - Switch all SubGraph classes to subgraph_view function - Introduce deprecated functions that act like the deprecated classes. Still need to: - add docs - add tests - make sure backward compatible and marked as deprecated - remove GraphView and SubGraph construct from rest of codebase - update release docs Fixes #2889 Fixes #2793 Fixes #2796 Fixes #2741 * Ease subclassing for to_(un)directed - add to_directed_class indicator functions to base classes - start deprecating G.fresh_copy - update function.to(un)directed * Remove G.fresh_copy from code replace with __class__ Add deprecation warnings for GraphView classes, ReverseView and SubGraph. Also for fresh_copy function.
* Remove cyclic reference in G.root_graph (#3014)Dan Schult2018-06-161-34/+1
| | | | | | | | * 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()
* Misc. typos (#2872)luzpaz2018-02-141-1/+1
| | | | | | | | | | Found via `codespell -q 3 -I ../networkx-whitelist.txt` where whitelist consisted of: ``` ans childs iff nd te ```
* Pep8 fixesJarrod Millman2018-01-201-3/+3
|
* Update copyrightJarrod Millman2018-01-201-1/+1
|
* Unravel subgraph chains (#2635)Dan Schult2017-08-261-0/+12
| | | | | | | | | | | | * Shortcut chains of subgraph views in common cases. Turns out the general case of chains of subgraph views is hard to make a shortcut for. So this only does the common case of node induced subgraphs of subgraphs. * Add tests for subgraph chains * Add more tests of chains of subgraphs
* Comply with pep8Jarrod Millman2017-08-171-3/+3
|
* Next attempt to meld graphviews with base classes (#2593)Dan Schult2017-08-121-28/+97
| | | | | | | | | | | | | | | | | | | | | | * 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.
* WIP Add reversed view and to_(un)directed view (#2565)Dan Schult2017-07-311-0/+162
* Add reversed/to_directed/to_undirected views Refactor views. Add tests. * correct treatment of slots in coreviews * Add tests for subgraph filters and to show #2048 reported bug The bug in #2048 would be fixed by the subgraph view machinery. * Fix to_(un)directed when already that direction * Rename subgraph module to avoid conflict * Simplify subgraphviews and tests * refactor subgraphviews to fit coreviews structure * Move subgraphviews into graphviews * Rename views.py to reportviews.py * Move functions out of views modules into function.py and simplify * separate contextmanager from views for now. * Fix induced_subgraph in function.py * get reshuffle of modules right