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

experimental init: Fix Solara import by making it lazy #2357

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

EwoutH
Copy link
Member

@EwoutH EwoutH commented Oct 15, 2024

In the experimental __init__.py, it always tries to import the "old" solara_viz module, even if it's not needed because only the cell space is used. This PR wraps that in a try block to also allow using the experimental cell space without Solara installed.

Quick and dirty fix for #2343, follow up after #2265, unblocks projectmesa/mesa-examples#198.

@EwoutH EwoutH added the bug Release notes label label Oct 15, 2024
@EwoutH EwoutH added this to the v3.0 milestone Oct 15, 2024
Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +0.8% [+0.0%, +1.6%] 🔵 +1.3% [+1.1%, +1.4%]
BoltzmannWealth large 🔵 -0.7% [-2.2%, +0.8%] 🔵 +1.0% [-0.2%, +2.1%]
Schelling small 🔵 -0.4% [-1.0%, +0.2%] 🔵 +0.1% [-0.4%, +0.7%]
Schelling large 🔵 -0.9% [-2.2%, +0.5%] 🟢 -6.4% [-8.8%, -4.4%]
WolfSheep small 🔵 -0.8% [-1.3%, -0.4%] 🔵 +0.5% [+0.1%, +1.0%]
WolfSheep large 🔵 -0.3% [-1.3%, +0.8%] 🔵 +1.3% [-1.7%, +4.8%]
BoidFlockers small 🔵 +0.6% [-0.1%, +1.3%] 🔵 +1.5% [+0.7%, +2.2%]
BoidFlockers large 🔵 +1.6% [+0.5%, +2.6%] 🔵 +1.2% [+0.8%, +1.7%]

@EwoutH EwoutH merged commit 48dc35f into projectmesa:main Oct 15, 2024
9 of 12 checks passed
@EwoutH EwoutH deleted the fix_experimental_solara_import branch October 26, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants