Skip to content

Commit

Permalink
Merge pull request #6 from yahoo/plot-optional
Browse files Browse the repository at this point in the history
make plotting dependencies optional
  • Loading branch information
pumpikano authored Jan 31, 2017
2 parents 6a31eeb + 4e6f884 commit e044eac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions graphkit/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

import time
import os
import pydot
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

from io import StringIO

Expand Down Expand Up @@ -297,6 +294,9 @@ def plot(self, filename=None, show=False):
An instance of the pydot graph
"""
import pydot
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

assert self.graph is not None

Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
author_email='huyng@yahoo-inc.com',
url='http://github.com/yahoo/graphkit',
packages=['graphkit'],
install_requires=['networkx', 'pydot', 'matplotlib'],
install_requires=['networkx'],
extras_require={
'plot': ['pydot', 'matplotlib']
},
tests_require=['numpy'],
license='Apache-2.0',
keywords=['graph', 'computation graph', 'DAG', 'directed acyclical graph'],
Expand Down

0 comments on commit e044eac

Please sign in to comment.