Skip to content

Commit

Permalink
fix broken mesa dependencies in GeoJupyterViz
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-boyu committed Dec 21, 2024
1 parent 04c1c7f commit 92c869a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit 92c869a

Please sign in to comment.