Skip to content

Commit 79bde5a

Browse files
rlskoesertpike3
authored andcommitted
Reference model step count directly for markdown output
per @rht feedback
1 parent a385d17 commit 79bde5a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

mesa/experimental/jupyter_viz.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,9 @@ def make_model():
181181
# 3. Buttons
182182
playing = solara.use_reactive(False)
183183

184-
# 4. Status indicators
185-
#: current round step count
186-
step = solara.use_reactive(True)
187-
188184
def on_value_play(change):
189185
if viz.model.running:
190186
viz.do_step()
191-
step.value = viz.model.schedule.steps
192187
else:
193188
playing.value = False
194189

@@ -212,7 +207,7 @@ def on_value_play(change):
212207
playing=playing.value,
213208
on_playing=playing.set,
214209
)
215-
solara.Markdown(md_text="**Step:** %d" % step.value)
210+
solara.Markdown(md_text=f"**Step:** {viz.model.schedule.steps}")
216211
# threaded_do_play is not used for now because it
217212
# doesn't work in Google colab. We use
218213
# ipywidgets.Play until it is fixed. The threading

0 commit comments

Comments
 (0)