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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mesa/experimental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

from mesa.experimental import cell_space

from .solara_viz import JupyterViz, Slider, SolaraViz, make_text
try:
from .solara_viz import JupyterViz, Slider, SolaraViz, make_text

__all__ = ["cell_space", "JupyterViz", "SolaraViz", "make_text", "Slider"]
__all__ = ["cell_space", "JupyterViz", "Slider", "SolaraViz", "make_text"]
except ImportError:
print(

Check warning on line 10 in mesa/experimental/__init__.py

View check run for this annotation

Codecov / codecov/patch

mesa/experimental/__init__.py#L9-L10

Added lines #L9 - L10 were not covered by tests
"Could not import SolaraViz. If you need it, install with 'pip install --pre mesa[viz]'"
)
__all__ = ["cell_space"]

Check warning on line 13 in mesa/experimental/__init__.py

View check run for this annotation

Codecov / codecov/patch

mesa/experimental/__init__.py#L13

Added line #L13 was not covered by tests
Loading