Repository navigation
Issue 762 shortest path hide nodes edges - #1011
Closed
francis-shuoch wants to merge 2 commits into
Closed
francis-shuoch wants to merge 2 commits into
francis-shuoch wants to merge 2 commits into
Conversation
…ing monkey patching.
… dense.py not using monkey patching. Because the algorithms in dense.py doesn't fit the neighbor_iter() paradigm.
Member
|
The way I had in mind to use the context manager was to not modify any of the shortest path functions and instead do e.g. with hidden_nodes(G, nodes=exclude) as H:
path = nx.shortest_path(H,source,target)It seems the basic concept can work in this specific case. The hidden edges function should be separate I think. |
Member
|
I suggest we implement a "view" concept instead of this approach #1896 |
This was referenced Jul 12, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I add the monkey patching context manager in a separate file named
restrictions.py. I'm glad to hear your code reviews. About testing, I add some in thetest_generics.py, because I think it duplicated if I also test them intest_weight.pyortest_unweight.py, etc. Let me know if you have concerns about adding more tests. ;)