-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update viz tutorial to the new API #2289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
SpaceGraph = make_space_matplotlib(agent_portrayal)
GiniPlot = make_plot_measure("Gini")
Maybe add a comment above these lines what’s exactly happening here.
Thanks! |
Quick question: did the model in the viz tutorial run very slowly with the new Solara viz api, as compared with the previous implementation? @Corvince Same thing happened for the mesa-geo intro tutorial model, when I try to update the tutorial to use the new api (projectmesa/mesa-geo#246). |
Hmm I haven't noticed any significant performance degradations. Under some circumstances that I do not fully understand yet I experience it to be quite slow, but this has also happened to me with the old API. If there are any performance problems it will probably be due to the updates of the ModelController. But I also think the frontend is too slow. But this seems to be mainly due to the used components. I tested displaying only the number of steps and this runs with several dozen steps/sec, so the solara stack doesn't seem to be the problem, mainly the space drawing is. Maybe this could somehow be optimized |
I tested the viz tutorial on Colab with an intent to reproduce the slowness. Encountered another issue: it produced the Matplotlib output just fine, but the control buttons (play/pause/reset/reseed/...) are not rendered, and so I couldn't play the simulation to see whether it is the evolution that is slow or something else. |
That's bad! I sometimes had the local issue that the ModelController had appeared after the main components. Maybe that's related. I will also investigate this on colab |
Thanks for your reply @Corvince. I see that in the new Model controller, the entire Would you like to try this on your machine @rht ? Thanks for looking into this! |
Running locally, I was able to click the hamburger button, which then revealed the control buttons. And I confirm that each steps took 2-3 s, i.e. very slow for a simple Boltzmann wealth model. |
Strange, i'll have to look at it from another laptop. Does this happen for both step and play/pause? |
The step is much more immediate, sub 1 s response time. |
Quick update to use the new SolaraViz Update. More updates to highlight more features should go into a separate PR, this is just to have it working again