Skip to content

Commit 2bc88ae

Browse files
committed
fix gis examples by passing solaraviz components as keyword argument
1 parent 86f1521 commit 2bc88ae

7 files changed

Lines changed: 20 additions & 20 deletions

File tree

gis/agents_and_networks/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ def parse_args():
5353
model = AgentsAndNetworks()
5454
page = SolaraViz(
5555
model,
56-
[
56+
name="Agents and Networks",
57+
model_params=model_params,
58+
components=[
5759
make_geospace_component(agent_draw, zoom=campus_params[campus]["zoom"]),
5860
make_plot_clock,
5961
make_plot_component(["status_home", "status_work", "status_traveling"]),
6062
make_plot_component(["friendship_home", "friendship_work"]),
6163
],
62-
name="Agents and Networks",
63-
model_params=model_params,
6464
)
6565

6666
page # noqa

gis/geo_schelling/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def schelling_draw(agent):
3030
model = GeoSchelling()
3131
page = SolaraViz(
3232
model,
33-
[
33+
name="GeoSchelling",
34+
model_params=model_params,
35+
components=[
3436
make_geospace_component(schelling_draw, zoom=4),
3537
make_plot_component(["happy"]),
3638
make_plot_happiness,
3739
],
38-
model_params=model_params,
39-
name="GeoSchelling",
4040
)
4141

4242
page # noqa

gis/geo_schelling_points/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def schelling_draw(agent):
3434
model = GeoSchellingPoints()
3535
page = SolaraViz(
3636
model,
37-
[
37+
name="GeoSchellingPoints",
38+
model_params=model_params,
39+
components=[
3840
make_geospace_component(schelling_draw, zoom=4),
3941
make_plot_component(["happy", "unhappy"]),
4042
make_plot_happiness,
4143
],
42-
model_params=model_params,
43-
name="GeoSchellingPoints",
4444
)
4545

4646
page # noqa

gis/geo_sir/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def infected_draw(agent):
2929
model = GeoSir()
3030
page = SolaraViz(
3131
model,
32-
[
32+
name="Basic agent-based SIR model",
33+
model_params=model_params,
34+
components=[
3335
make_geospace_component(infected_draw, zoom=12),
3436
make_plot_component(["infected", "susceptible", "recovered", "dead"]),
3537
],
36-
name="Basic agent-based SIR model",
37-
model_params=model_params,
3838
)
3939

4040
page # noqa

gis/population/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ def agent_portrayal(agent):
3232
model = Population()
3333
page = SolaraViz(
3434
model,
35-
[
35+
name="Population Model",
36+
components=[
3637
make_geospace_component(agent_portrayal),
3738
make_plot_num_agents,
3839
],
39-
name="Population Model",
4040
)
4141

4242
page # noqa

gis/rainfall/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def cell_portrayal(cell: LakeCell) -> tuple[float, float, float, float]:
2929
model = Rainfall()
3030
page = SolaraViz(
3131
model,
32-
[
32+
name="Rainfall Model",
33+
model_params=model_params,
34+
components=[
3335
make_geospace_component(cell_portrayal, zoom=11),
3436
make_plot_component(
3537
["Total Amount of Water", "Total Contained", "Total Outflow"]
3638
),
3739
],
38-
name="Rainfall Model",
39-
model_params=model_params,
4040
)
4141

4242
page # noqa

gis/urban_growth/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def make_plot_urbanized(model):
3333
model = UrbanGrowth()
3434
page = SolaraViz(
3535
model,
36-
[
36+
name="Urban Growth Model",
37+
model_params=model_params,
38+
components=[
3739
make_geospace_component(cell_portrayal, zoom=12.1),
3840
make_plot_component(["Percentage Urbanized"]),
3941
make_plot_urbanized,
4042
],
41-
name="Urban Growth Model",
42-
model_params=model_params,
4343
)
4444

4545
page # noqa

0 commit comments

Comments
 (0)