From 23166350d0e3af6a8f286babe02cadf1276370d6 Mon Sep 17 00:00:00 2001 From: Wang Boyu Date: Wed, 25 Dec 2024 10:42:57 +0800 Subject: [PATCH] gis: use make_geospace_component in SolaraViz --- gis/agents_and_networks/app.py | 4 ++-- gis/agents_and_networks/requirements.txt | 2 +- gis/geo_schelling/app.py | 4 ++-- gis/geo_schelling/requirements.txt | 2 +- gis/geo_schelling_points/app.py | 4 ++-- gis/geo_schelling_points/requirements.txt | 2 +- gis/geo_sir/app.py | 4 ++-- gis/geo_sir/requirements.txt | 2 +- gis/population/app.py | 4 ++-- gis/population/requirements.txt | 2 +- gis/rainfall/app.py | 4 ++-- gis/rainfall/requirements.txt | 2 +- gis/urban_growth/app.py | 4 ++-- gis/urban_growth/requirements.txt | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gis/agents_and_networks/app.py b/gis/agents_and_networks/app.py index 2e08317a..cce56433 100644 --- a/gis/agents_and_networks/app.py +++ b/gis/agents_and_networks/app.py @@ -1,7 +1,7 @@ import sys from mesa.visualization import Slider, SolaraViz, make_plot_component -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component from src.model.model import AgentsAndNetworks from src.visualization.utils import agent_draw, make_plot_clock @@ -54,7 +54,7 @@ def parse_args(): page = SolaraViz( model, [ - make_geospace_leaflet(agent_draw, zoom=campus_params[campus]["zoom"]), + make_geospace_component(agent_draw, zoom=campus_params[campus]["zoom"]), make_plot_clock, make_plot_component(["status_home", "status_work", "status_traveling"]), make_plot_component(["friendship_home", "friendship_work"]), diff --git a/gis/agents_and_networks/requirements.txt b/gis/agents_and_networks/requirements.txt index a6b20378..8bb22116 100644 --- a/gis/agents_and_networks/requirements.txt +++ b/gis/agents_and_networks/requirements.txt @@ -2,7 +2,7 @@ -e . # external requirements -mesa-geo~=0.9.0a0 +mesa-geo~=0.9.0 geopandas numpy pandas diff --git a/gis/geo_schelling/app.py b/gis/geo_schelling/app.py index afed0142..f19a99c7 100644 --- a/gis/geo_schelling/app.py +++ b/gis/geo_schelling/app.py @@ -1,6 +1,6 @@ import solara from mesa.visualization import Slider, SolaraViz, make_plot_component -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component from model import GeoSchelling @@ -33,7 +33,7 @@ def schelling_draw(agent): page = SolaraViz( model, [ - make_geospace_leaflet(schelling_draw, zoom=4), + make_geospace_component(schelling_draw, zoom=4), make_plot_component(["happy"]), make_plot_happiness, ], diff --git a/gis/geo_schelling/requirements.txt b/gis/geo_schelling/requirements.txt index 6d998684..7b40c998 100644 --- a/gis/geo_schelling/requirements.txt +++ b/gis/geo_schelling/requirements.txt @@ -1 +1 @@ -mesa-geo~=0.9.0a0 +mesa-geo~=0.9.0 diff --git a/gis/geo_schelling_points/app.py b/gis/geo_schelling_points/app.py index 091e4c8a..1af2a74e 100644 --- a/gis/geo_schelling_points/app.py +++ b/gis/geo_schelling_points/app.py @@ -2,7 +2,7 @@ from geo_schelling_points.agents import PersonAgent, RegionAgent from geo_schelling_points.model import GeoSchellingPoints from mesa.visualization import Slider, SolaraViz, make_plot_component -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component def make_plot_happiness(model): @@ -35,7 +35,7 @@ def schelling_draw(agent): page = SolaraViz( model, [ - make_geospace_leaflet(schelling_draw, zoom=4), + make_geospace_component(schelling_draw, zoom=4), make_plot_component(["happy", "unhappy"]), make_plot_happiness, ], diff --git a/gis/geo_schelling_points/requirements.txt b/gis/geo_schelling_points/requirements.txt index 6d998684..7b40c998 100644 --- a/gis/geo_schelling_points/requirements.txt +++ b/gis/geo_schelling_points/requirements.txt @@ -1 +1 @@ -mesa-geo~=0.9.0a0 +mesa-geo~=0.9.0 diff --git a/gis/geo_sir/app.py b/gis/geo_sir/app.py index 7a76151c..5628212d 100644 --- a/gis/geo_sir/app.py +++ b/gis/geo_sir/app.py @@ -1,7 +1,7 @@ from geo_sir.agents import PersonAgent from geo_sir.model import GeoSir from mesa.visualization import Slider, SolaraViz, make_plot_component -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component model_params = { "pop_size": Slider("Population size", 30, 10, 100, 10), @@ -32,7 +32,7 @@ def infected_draw(agent): page = SolaraViz( model, [ - make_geospace_leaflet(infected_draw, zoom=12), + make_geospace_component(infected_draw, zoom=12), make_plot_component(["infected", "susceptible", "recovered", "dead"]), ], name="Basic agent-based SIR model", diff --git a/gis/geo_sir/requirements.txt b/gis/geo_sir/requirements.txt index 6d998684..7b40c998 100644 --- a/gis/geo_sir/requirements.txt +++ b/gis/geo_sir/requirements.txt @@ -1 +1 @@ -mesa-geo~=0.9.0a0 +mesa-geo~=0.9.0 diff --git a/gis/population/app.py b/gis/population/app.py index 404b39ff..c39f8e31 100644 --- a/gis/population/app.py +++ b/gis/population/app.py @@ -1,7 +1,7 @@ import mesa_geo as mg import solara from mesa.visualization import SolaraViz -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component from population.model import Population from population.space import UgandaCell from shapely.geometry import Point, Polygon @@ -33,7 +33,7 @@ def agent_portrayal(agent): page = SolaraViz( model, [ - make_geospace_leaflet(agent_portrayal), + make_geospace_component(agent_portrayal), make_plot_num_agents, ], name="Population Model", diff --git a/gis/population/requirements.txt b/gis/population/requirements.txt index 30d02edc..7b40c998 100644 --- a/gis/population/requirements.txt +++ b/gis/population/requirements.txt @@ -1 +1 @@ -mesa-geo~=0.9.0a1 +mesa-geo~=0.9.0 diff --git a/gis/rainfall/app.py b/gis/rainfall/app.py index 1c5a72b5..630fd8b9 100644 --- a/gis/rainfall/app.py +++ b/gis/rainfall/app.py @@ -1,7 +1,7 @@ from typing import Tuple from mesa.visualization import Slider, SolaraViz, make_plot_component -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component from rainfall.model import Rainfall from rainfall.space import LakeCell @@ -32,7 +32,7 @@ def cell_portrayal(cell: LakeCell) -> Tuple[float, float, float, float]: page = SolaraViz( model, [ - make_geospace_leaflet(cell_portrayal, zoom=11), + make_geospace_component(cell_portrayal, zoom=11), make_plot_component( ["Total Amount of Water", "Total Contained", "Total Outflow"] ), diff --git a/gis/rainfall/requirements.txt b/gis/rainfall/requirements.txt index 30d02edc..7b40c998 100644 --- a/gis/rainfall/requirements.txt +++ b/gis/rainfall/requirements.txt @@ -1 +1 @@ -mesa-geo~=0.9.0a1 +mesa-geo~=0.9.0 diff --git a/gis/urban_growth/app.py b/gis/urban_growth/app.py index bd426d8c..e74d3415 100644 --- a/gis/urban_growth/app.py +++ b/gis/urban_growth/app.py @@ -2,7 +2,7 @@ import solara from mesa.visualization import Slider, SolaraViz, make_plot_component -from mesa_geo.visualization import make_geospace_leaflet +from mesa_geo.visualization import make_geospace_component from urban_growth.model import UrbanGrowth from urban_growth.space import UrbanCell @@ -36,7 +36,7 @@ def make_plot_urbanized(model): page = SolaraViz( model, [ - make_geospace_leaflet(cell_portrayal, zoom=12.1), + make_geospace_component(cell_portrayal, zoom=12.1), make_plot_component(["Percentage Urbanized"]), make_plot_urbanized, ], diff --git a/gis/urban_growth/requirements.txt b/gis/urban_growth/requirements.txt index 301b776a..832a9d15 100644 --- a/gis/urban_growth/requirements.txt +++ b/gis/urban_growth/requirements.txt @@ -1 +1 @@ -mesa-geo~=0.9.0a1 \ No newline at end of file +mesa-geo~=0.9.0 \ No newline at end of file