Skip to content

Commit

Permalink
add examples zoom and resize image tests (#628)
Browse files Browse the repository at this point in the history
* add examples zoom and resize image tests

* bump uber h3 example image tolerance
  • Loading branch information
bjlittle authored Jan 9, 2024
1 parent 49832ae commit 681c9be
Show file tree
Hide file tree
Showing 40 changed files with 79 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/geovista/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
BASE_URL: str = "https://github.com/bjlittle/geovista-data/raw/{version}/data/"

#: Pin to use the specific geovista-data repository version for geovista resources.
DATA_VERSION: str = "2023.12.13"
DATA_VERSION: str = "2024.01.0"

#: Environment variable to override pooch cache manager path.
ENV: str = "GEOVISTA_CACHEDIR"
Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/clouds_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
3 changes: 2 additions & 1 deletion src/geovista/examples/curvilinear/from_2d__orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main() -> None:
# Plot the curvilinear grid.
plotter = gv.GeoPlotter()
sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True}
plotter.add_mesh(mesh, scalar_bar_args=sargs)
plotter.add_mesh(mesh, scalar_bar_args=sargs, show_edges=True)
plotter.add_base_layer(texture=gv.natural_earth_1())
plotter.add_coastlines()
plotter.add_axes()
Expand All @@ -67,6 +67,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/curvilinear/from_2d__orca_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/rectilinear/from_1d__oisst.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/rectilinear/from_1d__oisst_eqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/scalar_data/earthquakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xz(negative=True)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/scalar_data/earthquakes_wink1.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/spatial_index/uber_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ def main() -> None:
shadow=True,
)
plotter.add_coastlines()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/dynamico.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xz(negative=True)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/dynamico_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.2)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/fesom.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/fesom_fouc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main() -> None:
shadow=True,
)
plotter.view_yz()
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/icon_eqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/lam_pacific.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/lam_pacific_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
3 changes: 2 additions & 1 deletion src/geovista/examples/unstructured/lfric_sst.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def main() -> None:
# Plot the unstructured mesh.
plotter = gv.GeoPlotter()
sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True}
plotter.add_mesh(mesh, scalar_bar_args=sargs)
plotter.add_mesh(mesh, scalar_bar_args=sargs, show_edges=True)
plotter.add_base_layer(texture=gv.natural_earth_1())
plotter.add_coastlines()
plotter.add_graticule()
Expand All @@ -74,6 +74,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/lfric_sst_bonne.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/smc.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/smc_sinu.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/tri.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/unstructured/tri_hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/vector_data/vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def main() -> None:
plotter.add_base_layer(texture=gv.natural_earth_1(), zlevel=0, lighting=False)
plotter.add_mesh(mesh.arrows, lighting=False)
plotter.add_axes()
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
1 change: 1 addition & 0 deletions src/geovista/examples/warp/from_unstructured__fvcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.2)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def main() -> None:
font_size=10,
shadow=True,
)
plotter.camera.zoom(1.3)
plotter.show()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def main() -> None:
shadow=True,
)
plotter.view_xy()
plotter.camera.zoom(1.5)
plotter.show()


Expand Down
Loading

0 comments on commit 681c9be

Please sign in to comment.