Skip to content

Profile any statement as a DOT graph in JupyterLab or Notebook

License

Notifications You must be signed in to change notification settings

mattijn/gprof2dot_magic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gprof2dot_magic

Magic function for gprof2dot to profile any Python statement as a DOT graph in JupyterLab or Jupyter Notebook.

installation

Make sure you've the Python package gprof2dot_magic.

pip install gprof2dot_magic

This will also install its dependencies gprof2dot and graphviz.

It is also important to have the Graphviz software installed.

Apperently you can use conda as such (I don't have conda):

conda install python-graphviz

Without conda

For macOS:

brew install graphviz

For Windows (source):

Note: close your "cmd" in which jupyter lab/notebook is running. Existing running CMD dont catch the new changes in Environment variables

usage

To enable the magic function, first load the gprof2dot_magic module

%load_ext gprof2dot_magic

and then profile any line statement as a DOT graph as such:

%gprof2dot print('hello world')

About

Profile any statement as a DOT graph in JupyterLab or Notebook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published