Skip to content

Commit 39ef243

Browse files
committed
matplotlib optional
1 parent 1965bf3 commit 39ef243

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

l0bnb/viz.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import matplotlib.pyplot as plt
2-
3-
41
def graph_plot(x, y, x_axis, y_axis, title, loglog=True):
2+
try:
3+
import matplotlib.pyplot as plt
4+
except ModuleNotFoundError:
5+
raise Exception('matplotlib is not installed')
56
plt.figure()
67
func = plt.plot if not loglog else plt.loglog
78
func(x, y, color='r', linestyle='-')
@@ -12,4 +13,8 @@ def graph_plot(x, y, x_axis, y_axis, title, loglog=True):
1213

1314

1415
def show_plots():
16+
try:
17+
import matplotlib.pyplot as plt
18+
except ModuleNotFoundError:
19+
raise Exception('matplotlib is not installed')
1520
plt.show()

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ def readme():
1414
author="Hussein Hazimeh, Rahul Mazumder, Ali Saab",
1515
author_email="alikassemsaab@gmail.com",
1616
url='https://github.com/alisaab/l0bnb',
17-
download_url="https://github.com/alisaab/l0bnb/archive/0.0.4.tar.gz",
18-
install_requires=["numpy >= 1.18.2", "scipy >= 1.4.1", "numba >= 0.48.0",
19-
"matplotlib >= 3.2.1"],
20-
version="0.0.4",
17+
download_url="https://github.com/alisaab/l0bnb/archive/0.0.5.tar.gz",
18+
install_requires=["numpy >= 1.18.2", "scipy >= 1.4.1", "numba >= 0.48.0"],
19+
version="0.0.5",
2120
packages=find_packages(),
2221
include_package_data=True,
2322
license=LICENSE,

0 commit comments

Comments
 (0)