Migrated my call_graph page from my unversioned homepage to this blog.
authorW. Trevor King <wking@drexel.edu>
Thu, 30 Sep 2010 18:18:07 +0000 (14:18 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 30 Sep 2010 18:18:07 +0000 (14:18 -0400)
posts/call_graph.mdwn [new file with mode: 0644]
posts/call_graph/call_graph.png [new file with mode: 0644]
posts/depgraph.mdwn

diff --git a/posts/call_graph.mdwn b/posts/call_graph.mdwn
new file mode 100644 (file)
index 0000000..02fc3db
--- /dev/null
@@ -0,0 +1,25 @@
+This script scans a Python file for function dependencies, and
+generates code for [Graphviz dot][graphviz].  See [[depgraph]] for
+scripts to generate dependency graphs *between* modules.
+
+Originally by [Prashantha Ellina][original], the [script][call_graph]
+is good for giving you the "short view" for restructuring a single
+module.
+
+As example, here is the callgraph of my cantilever calibration program
+[calibrate_cantilever.py][].
+
+    $ python construct_call_graph.py -i calibrate_cantilever.py | dot -T png -o call_graph.png
+
+[[!img call_graph.png class="scaled"
+  alt="calibrate_cantilever.py call graph"
+  title="calibrate_cantilever.py call graph"]]
+
+[graphviz]: http://www.graphviz.org
+[original]: http://blog.prashanthellina.com/2007/11/14/generating-call-graphs-for-understanding-and-refactoring-python-code/
+[calibrate_cantilever.py]: http://www.physics.drexel.edu/~wking/code/git/git.php?p=calibrate_cantilever.git
+[call_graph]: http://www.physics.drexel.edu/~wking/code/git/git.php?p=call_graph.git
+
+[[!tag tags/programming]]
+[[!tag togs/python]]
+[[!tag tags/tools]]
diff --git a/posts/call_graph/call_graph.png b/posts/call_graph/call_graph.png
new file mode 100644 (file)
index 0000000..86ba0c5
Binary files /dev/null and b/posts/call_graph/call_graph.png differ
index 098a88cb01b4b5d12ae750bdd7ec9b5b8d9c1f2a..4100aaff03d21885e438189dc8b15e55a8cd45c9 100644 (file)
@@ -1,9 +1,10 @@
 This set of scripts scans a Python file for module dependencies, and
-generates code for [Graphviz dot][graphviz].
+generates code for [Graphviz dot][graphviz].  See [[call_graph]] for a
+script that generates dependency graphs *within* a module.
 
-Originally by Toby Dickenson.  Good for giving you the "long view" on
-how your project is organized.  I've [altered][] the [originals][] a
-bit.
+Originally by Toby Dickenson, the scripts are good for giving you the
+"long view" on how your project is organized.  I've [altered][] the
+[originals][] a bit.
 
 My `py2depgraph` also prints out path information for each module, so
 that you can show or hide module nodes based on those paths.  For
@@ -43,5 +44,6 @@ in their paths.
 [originals]: http://tarind.com/depgraph.html
 [unfold.py]: http://www.physics.drexel.edu/~wking/code/git/git.php?p=unfold_protein.git
 
-[[!tag tags/tools]]
 [[!tag tags/programming]]
+[[!tag togs/python]]
+[[!tag tags/tools]]