Skip to content

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

Merged
EwoutH merged 2 commits intomesa:mainfrom
EwoutH:fix_experimental_solara_import
Oct 15, 2024
Merged

experimental init: Fix Solara import by making it lazy#2357
EwoutH merged 2 commits intomesa:mainfrom
EwoutH:fix_experimental_solara_import

Conversation

@EwoutH
Copy link
Copy Markdown
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 mesa/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
@EwoutH EwoutH requested review from Corvince and quaquel October 15, 2024 06:37
@github-actions
Copy link
Copy Markdown

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 mesa:main Oct 15, 2024
@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