Skip to content

Commit 9363a69

Browse files
committed
remove IPython from requirements
1 parent fe30752 commit 9363a69

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

discopy/drawing.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import networkx as nx
1010
from PIL import Image
11-
from IPython.display import HTML
1211
import matplotlib.pyplot as plt
1312
from matplotlib.path import Path
1413
from matplotlib.patches import PathPatch
@@ -327,7 +326,11 @@ def to_gif(diagram, *diagrams, path=None,
327326
frames[0].save(path, format='GIF', append_images=frames[1:],
328327
save_all=True, duration=timestep,
329328
**{'loop': 0} if loop else {})
330-
return HTML('<img src="{}">'.format(path))
329+
try:
330+
from IPython.display import HTML
331+
return HTML('<img src="{}">'.format(path))
332+
except ImportError:
333+
return '<img src="{}">'.format(path)
331334

332335

333336
def pregroup_draw(words, cups, **params):

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
ipython>=7.10.1
21
numpy>=1.18.1
32
networkx>=2.4
43
matplotlib>=3.1.2

0 commit comments

Comments
 (0)