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

Set JupyterViz as stable #2090

Merged
merged 3 commits into from
May 8, 2024
Merged

Set JupyterViz as stable #2090

merged 3 commits into from
May 8, 2024

Conversation

rht
Copy link
Contributor

@rht rht commented Mar 27, 2024

This PR stabilizes the new Jupyter Visualisation. A new tutorial is available here: https://mesa.readthedocs.io/en/latest/tutorials/visualization_tutorial.html

If you already use the new visualisation, and want to keep using it, you need to change the import from from mesa.experimental.jupyter_viz import JupyterViz to from mesa.visualization.jupyter_viz import JupyterViz

If you want to want to keep using the old visualisation, you can do so by using the Mesa 2.3.x releases. Mesa 3.0 won't be supporting it.

Copy link

Performance benchmarks:

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

@EwoutH
Copy link
Member

EwoutH commented Mar 27, 2024

Does this break existing models?

@rht
Copy link
Contributor Author

rht commented Mar 27, 2024

This is an API breaking change because of the first commit.

@EwoutH
Copy link
Member

EwoutH commented Mar 27, 2024

Good to know! Should we do it in two stages:

  • For 2.3, just add a warning we're going to (re)move it
  • For 3.0, actually (re)move it

I might also be a proponent of just removing it in 3.0. You can always keep using the older versions if you want or need to. That keeps the codebase clean and lean.

@EwoutH
Copy link
Member

EwoutH commented Apr 17, 2024

I think we can't include this in 2.3 since it's breaking. So we would add a warning for 2.3.0 that we will remove it in 3.0. @rht could you open a separate PR that adds a deprecation warning to the old visualisation?

Then we can merge this PR as soon as 2.3 is branched - which will be this week.

@EwoutH EwoutH added this to the [FUTURE] v3.0.0 milestone Apr 17, 2024
@tpike3
Copy link
Member

tpike3 commented Apr 17, 2024

To be clear on the process:
1 - Separate PR that has a deprecation warning.
2 - Merge this in 3.0

I would agree that we want to remove the old visualization code from the codebase entirely.

But will add, don't we want push people to mesa-viz-tornado? Interestingly other people updated it in February - update

As an aside always thinking about the ABM and Mesa ecosystem this add some intriguing questions on package management.

@EwoutH
Copy link
Member

EwoutH commented Apr 23, 2024

2.3 is released, so we can start with 3.0 development work, including moving this PR forward!

Deprecation warning for 2.3.x would still be nice though.

@rht rht marked this pull request as ready for review April 24, 2024 09:37
@rht
Copy link
Contributor Author

rht commented Apr 24, 2024

Should I remove the Tornado viz altogether? This will free up the default dependencies and documentation.

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
Schelling small 🔴 +16.5% [+16.1%, +16.9%] 🔴 +25.3% [+25.1%, +25.5%]
Schelling large 🔴 +16.2% [+15.8%, +16.6%] 🔴 +20.7% [+20.0%, +21.2%]
WolfSheep small 🔴 +23.6% [+22.2%, +25.1%] 🔴 +205.3% [+200.5%, +210.6%]
WolfSheep large 🔴 +22.4% [+21.7%, +23.1%] 🔴 +159.7% [+156.6%, +162.9%]
BoidFlockers small 🔴 +14.2% [+13.5%, +15.0%] 🔴 +10.3% [+9.5%, +11.1%]
BoidFlockers large 🔴 +13.1% [+12.3%, +13.8%] 🔴 +13.4% [+12.8%, +14.0%]

@EwoutH
Copy link
Member

EwoutH commented Apr 24, 2024

Should I remove the Tornado viz altogether?

I'm good with that. Maybe we need to write a (short) migration guide for 3.0, and include a deprecation warning linking to it when trying to import the old tornado viz.

@rht
Copy link
Contributor Author

rht commented Apr 24, 2024

I already wrote on Matrix several days ago

can't put warning on 2.3.0 because the old viz is a direct module import of mesa-viz-tornado classes
you can add to the release note instead

@EwoutH
Copy link
Member

EwoutH commented Apr 24, 2024

Right, then we do that.

Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like a second review on this, but from my perspective, this is good to go.

@rht
Copy link
Contributor Author

rht commented May 8, 2024

I'm merging now because if merge conflicts happen again, this is hard to redo.

@rht rht merged commit a2d4afe into projectmesa:main May 8, 2024
3 of 9 checks passed
@rht rht deleted the jupyterviz-stable branch May 8, 2024 05:14
@EwoutH
Copy link
Member

EwoutH commented May 8, 2024

Agreed! Let’s continue to test and develop this, we have quite some time before 3.0 stable.

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

Successfully merging this pull request may close these issues.

3 participants