Skip to content

Commit 70b2902

Browse files
rhttpike3
authored andcommitted
fix: Do render_in_jupyter on Colab env
1 parent 51a1306 commit 70b2902

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mesa/experimental/jupyter_viz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def render_in_browser():
152152
on_grid_layout=set_grid_layout,
153153
)
154154

155-
if "ipykernel" in sys.argv[0]:
155+
if ("ipykernel" in sys.argv[0]) or ("colab_kernel_launcher.py" in sys.argv[0]):
156+
# When in Jupyter or Google Colab
156157
render_in_jupyter()
157158
else:
158159
render_in_browser()

0 commit comments

Comments
 (0)