Skip to content

Commit

Permalink
fix: Do render_in_jupyter on Colab env
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and tpike3 committed Nov 22, 2023
1 parent 51a1306 commit 70b2902
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mesa/experimental/jupyter_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def render_in_browser():
on_grid_layout=set_grid_layout,
)

if "ipykernel" in sys.argv[0]:
if ("ipykernel" in sys.argv[0]) or ("colab_kernel_launcher.py" in sys.argv[0]):
# When in Jupyter or Google Colab
render_in_jupyter()
else:
render_in_browser()
Expand Down

0 comments on commit 70b2902

Please sign in to comment.