Wednesday, July 4, 2018

static analysis of function dependency in Python

With 1400 lines of Python, I wanted to find a way to visualize the static dependencies of functions internal to the script
https://github.com/allofphysicsgraph/proofofconcept/blob/gh-pages/v4_file_per_expression/bin/interactive_user_prompt.py

I looked at PyCallGraph but it only supports dynamic call graphs. In addition to Pyan and Snakefood, I found a blog post that included an AST parser as a single file.

python construct_call_graph.py -i ../../proofofconcept/v4_file_per_expression/bin/interactive_user_prompt.py > graph.dot

add "overlap=false;" in the graph.dot file

neato -Tpng graph.dot -o graph.png

which yields


No comments:

Post a Comment