Skip to content
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

viz: Combine code for rendering in browser and Jupyter #2180

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

rht
Copy link
Contributor

@rht rht commented Jul 14, 2024

This unifies the rendering code, simplifying it and reducing maintenance overhead. Solara now has a built-in way to show the sidebar, when the hamburger button is clicked. @tpike3 you might want to update the Mesa-Geo equivalent.
2024-07-14T13:56:19,646024398-04:00

@rht
Copy link
Contributor Author

rht commented Jul 14, 2024

Clarification: the screenshot was taken from a Jupyter notebook UI.

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
Schelling small 🔵 +0.1% [-0.2%, +0.4%] 🔵 +0.4% [+0.2%, +0.6%]
Schelling large 🔵 +0.4% [-0.3%, +1.1%] 🔵 +0.3% [-0.6%, +1.1%]
WolfSheep small 🔵 -0.1% [-1.0%, +0.6%] 🔵 -0.3% [-0.6%, -0.1%]
WolfSheep large 🔵 +0.1% [-0.2%, +0.4%] 🔵 -0.9% [-1.9%, -0.1%]
BoidFlockers small 🔵 +0.8% [+0.1%, +1.4%] 🔵 +0.4% [-0.4%, +1.1%]
BoidFlockers large 🔵 +1.4% [+0.7%, +2.0%] 🔵 -0.2% [-0.8%, +0.3%]

@rht rht added breaking Release notes label visualisation labels Jul 14, 2024
@rht
Copy link
Contributor Author

rht commented Jul 17, 2024

Request for review: @projectmesa/maintainers

@jackiekazil
Copy link
Member

@rht I took a look at this and tried to run it --- can you explicitly point me to the code that demonstrates this?

@jackiekazil jackiekazil self-requested a review July 18, 2024 03:28
@rht
Copy link
Contributor Author

rht commented Jul 18, 2024

You have to run https://github.com/projectmesa/mesa-examples/tree/main/examples/schelling_experimental (after manually editing from mesa.experimental import JupyterViz, ... to from mesa.visualization import JupyterViz, .... But more importantly, to test the UI change when rendered on a Jupyter notebook. There is no .ipynb on that example folder yet, so you have to copy-paste the app.py code to a fresh new notebook.

@jackiekazil
Copy link
Member

Thank you. I wonder if this is an opportunity to create an example of the solara app in a jupyter notebook?

Regardless, this LGTM.

@jackiekazil jackiekazil merged commit 07ac1e2 into projectmesa:main Jul 19, 2024
11 of 13 checks passed
@rht rht deleted the unify_jupyter_browser branch July 19, 2024 09:31
@rht
Copy link
Contributor Author

rht commented Jul 19, 2024

Will do during the revamp of the examples to Mesa 3.0.

@EwoutH
Copy link
Member

EwoutH commented Jul 20, 2024

Looks like good stuff, thanks for working on this!

@EwoutH EwoutH mentioned this pull request Aug 21, 2024
7 tasks
@EwoutH
Copy link
Member

EwoutH commented Sep 4, 2024

I would like to resolve this error in the stable version of our Visualization Tutorial.

image

Apparently this PR does that for the main mesa branch. Can we cherry pick some part of it (in a non-breaking way) to resolve this warning on Mesa 2.3.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Release notes label visualisation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants