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

fix broken mesa dependencies in GeoJupyterViz #269

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions mesa_geo/visualization/geojupyter_viz.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import warnings

import matplotlib.pyplot as plt
import mesa.experimental.components.matplotlib as components_matplotlib
import mesa.visualization.components.matplotlib_components as components_matplotlib
import solara
import xyzservices.providers as xyz
from mesa.experimental import solara_viz as jv
from mesa.visualization import solara_viz as jv
from solara.alias import rv

import mesa_geo.visualization.leaflet_viz as leaflet_viz
Expand Down
8 changes: 8 additions & 0 deletions tests/test_GeoJupyterViz.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,24 @@ def test_card_function(
@patch("mesa_geo.visualization.geojupyter_viz.jv.ModelController")
@patch("mesa_geo.visualization.geojupyter_viz.jv.UserInputs")
@patch("mesa_geo.visualization.geojupyter_viz.jv.split_model_params")
@patch("mesa_geo.visualization.geojupyter_viz.jv.make_initial_grid_layout")
@patch("mesa_geo.visualization.geojupyter_viz.solara.use_memo")
@patch("mesa_geo.visualization.geojupyter_viz.solara.use_reactive")
@patch("mesa_geo.visualization.geojupyter_viz.solara.use_state")
@patch("mesa_geo.visualization.geojupyter_viz.solara.AppBarTitle")
@patch("mesa_geo.visualization.geojupyter_viz.solara.AppBar")
@patch("mesa_geo.visualization.geojupyter_viz.leaflet_viz.MapModule")
@patch("mesa_geo.visualization.geojupyter_viz.rv.Card")
def test_geojupyterviz_function(
self,
mock_rv_Card, # noqa: N803
mock_MapModule, # noqa: N803
mock_AppBar, # noqa: N803
mock_AppBarTitle, # noqa: N803
mock_use_state,
mock_use_reactive,
mock_use_memo,
mock_make_initial_grid_layout,
mock_split_model_params,
mock_UserInputs, # noqa: N803
mock_ModelController, # noqa: N803
Expand All @@ -96,6 +100,10 @@ def test_geojupyterviz_function(
mock_split_model_params.return_value = ({}, {})
mock_use_state.return_value = ({}, MagicMock())
mock_use_memo.return_value = MagicMock()
mock_make_initial_grid_layout.return_value = {}

mock_rv_Card.return_value.__enter__ = MagicMock()
mock_rv_Card.return_value.__exit__ = MagicMock()

solara.render(
GeoJupyterViz(
Expand Down
Loading