-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a list of all possible function paths #1
Comments
Unfortunately, that's not supported. But you could extract that information by walking the graph in a variety of ways:
For option 2, specifically, look at So given a def make_chains(edges):
def make_chains_rec(from_node):
to_nodes = edges.get(from_node, [])
if len(to_nodes):
chains = []
for target in to_nodes:
tails = make_chains_rec(target)
for tail in tails:
chains.append([from_node] + tail)
return chains
else:
return [from_node]
all_chains = {}
for from_node in edges.keys():
all_chains[from_node] = analyzerec(from_node)
return all_chains
make_chains(analyzer.uses_edges) ...modulo any bugs. This is a fairly simple recursive problem, but I didn't actually test the solution ;) There's also a As for how to instantiate and run the Hope this helps! |
One more thing - once you have the output of (And there's at least one typo in the above code snippet - |
No new comments since end of May, closing issue. Feel free to re-open if needed. |
Pyan has been super helpful to me! However, I would like to use it in a different way to output, in addition to the current graphs, a list of all possible functions' paths start->end.
Right now, the Graph edges include the source and the target (e.g., A -> B and another edge B -> C). What I want to do is to print (A -> B -> C).
Is that currently supported? If not, where to start? Any guidance is appreciated.
I want the output to be something like:
A -> C -> D
A -> B -> C -> D
The text was updated successfully, but these errors were encountered: