From 107d2a18c96f433992044dce7f9c9fbdba0e09e6 Mon Sep 17 00:00:00 2001 From: rht Date: Thu, 18 Jan 2024 06:33:33 -0500 Subject: [PATCH] JupyterViz: Automatically deduce display name from model class --- mesa/experimental/jupyter_viz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesa/experimental/jupyter_viz.py b/mesa/experimental/jupyter_viz.py index 2e5f066409f..7a586239058 100644 --- a/mesa/experimental/jupyter_viz.py +++ b/mesa/experimental/jupyter_viz.py @@ -17,7 +17,7 @@ def JupyterViz( model_class, model_params, measures=None, - name="Mesa Model", + name=None, agent_portrayal=None, space_drawer="default", play_interval=150, @@ -35,6 +35,9 @@ def JupyterViz( specify `space_drawer=False` play_interval: play interval (default: 150) """ + if name is None: + name = model_class.__name__ + current_step = solara.use_reactive(0) # 1. Set up model parameters