From 5fd1be92b8acecbbae6d88ac84b8dd5a7d0b8dff Mon Sep 17 00:00:00 2001 From: Bill Little Date: Thu, 28 Sep 2023 00:55:16 +0100 Subject: [PATCH] revert examples off_screen kwarg --- src/geovista/examples/clouds.py | 4 ++-- src/geovista/examples/clouds_robin.py | 4 ++-- src/geovista/examples/earthquakes.py | 4 ++-- src/geovista/examples/earthquakes_wink1.py | 4 ++-- src/geovista/examples/from_1d__oisst.py | 4 ++-- src/geovista/examples/from_1d__oisst_eqc.py | 4 ++-- src/geovista/examples/from_1d__synthetic_face_m1_n1.py | 4 ++-- .../examples/from_1d__synthetic_face_m1_n1_robin.py | 4 ++-- src/geovista/examples/from_1d__synthetic_node_m1_n1.py | 4 ++-- .../examples/from_1d__synthetic_node_m1_n1_moll.py | 4 ++-- src/geovista/examples/from_2d__orca.py | 4 ++-- src/geovista/examples/from_2d__orca_moll.py | 4 ++-- src/geovista/examples/from_2d__synthetic_face_m1n1.py | 4 ++-- .../examples/from_2d__synthetic_face_m1n1_robin.py | 4 ++-- src/geovista/examples/from_2d__synthetic_node_m1n1.py | 4 ++-- .../examples/from_2d__synthetic_node_m1n1_moll.py | 4 ++-- src/geovista/examples/from_points__orca_cloud.py | 4 ++-- src/geovista/examples/from_points__orca_cloud_eqc.py | 4 ++-- src/geovista/examples/from_unstructured__fesom.py | 4 ++-- src/geovista/examples/from_unstructured__fesom_fouc.py | 4 ++-- src/geovista/examples/from_unstructured__fvcom.py | 4 ++-- src/geovista/examples/from_unstructured__icon.py | 4 ++-- src/geovista/examples/from_unstructured__icon_eqc.py | 4 ++-- src/geovista/examples/from_unstructured__icosahedral.py | 4 ++-- .../examples/from_unstructured__icosahedral_poly.py | 4 ++-- src/geovista/examples/from_unstructured__lam_pacific.py | 4 ++-- .../examples/from_unstructured__lam_pacific_moll.py | 4 ++-- src/geovista/examples/from_unstructured__lfric_orog.py | 4 ++-- .../examples/from_unstructured__lfric_orog_warp.py | 4 ++-- src/geovista/examples/from_unstructured__lfric_sst.py | 4 ++-- .../examples/from_unstructured__lfric_sst_bonne.py | 4 ++-- src/geovista/examples/from_unstructured__smc.py | 4 ++-- src/geovista/examples/from_unstructured__smc_sinu.py | 4 ++-- src/geovista/examples/from_unstructured__tri.py | 2 +- src/geovista/examples/from_unstructured__tri_hammer.py | 4 ++-- tests/plotting/test_examples.py | 8 ++++++-- 36 files changed, 75 insertions(+), 71 deletions(-) diff --git a/src/geovista/examples/clouds.py b/src/geovista/examples/clouds.py index e9ab323d..bd9a6df4 100755 --- a/src/geovista/examples/clouds.py +++ b/src/geovista/examples/clouds.py @@ -30,7 +30,7 @@ } -def main(off_screen: bool = False) -> None: +def main() -> None: """Create meshes from 1-D latitude and longitude unstructured cell points. The resulting meshes contain quad cells and are constructed from CF UGRID @@ -54,7 +54,7 @@ def main(off_screen: bool = False) -> None: clim = (cmin := 0.3, 1.0) # create the plotter - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() for i, cloud in enumerate(cmaps): # load the sample data diff --git a/src/geovista/examples/clouds_robin.py b/src/geovista/examples/clouds_robin.py index 4fdd8e14..cc308669 100755 --- a/src/geovista/examples/clouds_robin.py +++ b/src/geovista/examples/clouds_robin.py @@ -30,7 +30,7 @@ } -def main(off_screen: bool = False) -> None: +def main() -> None: """Create meshes from 1-D latitude and longitude unstructured cell points. The resulting meshes contain quad cells and are constructed from CF UGRID @@ -55,7 +55,7 @@ def main(off_screen: bool = False) -> None: # create the plotter crs = "+proj=robin" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) for i, cloud in enumerate(cmaps): # load the sample data diff --git a/src/geovista/examples/earthquakes.py b/src/geovista/examples/earthquakes.py index c84458d0..c309d9b9 100755 --- a/src/geovista/examples/earthquakes.py +++ b/src/geovista/examples/earthquakes.py @@ -15,7 +15,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a point cloud from a USGS earthquakes dataset. The resulting render contains a point cloud of M2.5+ earthquakes along @@ -56,7 +56,7 @@ def main(off_screen: bool = False) -> None: return # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": "Magnitude", "shadow": True} plotter.add_points( xs=sample.lons, diff --git a/src/geovista/examples/earthquakes_wink1.py b/src/geovista/examples/earthquakes_wink1.py index 67ca2822..aaaa0734 100755 --- a/src/geovista/examples/earthquakes_wink1.py +++ b/src/geovista/examples/earthquakes_wink1.py @@ -15,7 +15,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a point cloud from a USGS earthquakes dataset. The resulting render contains a point cloud of M2.5+ earthquakes along @@ -58,7 +58,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=wink1 +lon_0=180" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": "Magnitude", "shadow": True} plotter.add_points( xs=sample.lons, diff --git a/src/geovista/examples/from_1d__oisst.py b/src/geovista/examples/from_1d__oisst.py index 22183f32..3aa16129 100755 --- a/src/geovista/examples/from_1d__oisst.py +++ b/src/geovista/examples/from_1d__oisst.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -39,7 +39,7 @@ def main(off_screen: bool = False) -> None: mesh = mesh.threshold() # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.blue_marble()) diff --git a/src/geovista/examples/from_1d__oisst_eqc.py b/src/geovista/examples/from_1d__oisst_eqc.py index 94dc31d7..bbf6c931 100755 --- a/src/geovista/examples/from_1d__oisst_eqc.py +++ b/src/geovista/examples/from_1d__oisst_eqc.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -42,7 +42,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=eqc" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.blue_marble()) diff --git a/src/geovista/examples/from_1d__synthetic_face_m1_n1.py b/src/geovista/examples/from_1d__synthetic_face_m1_n1.py index 35ff77ed..387741fd 100755 --- a/src/geovista/examples/from_1d__synthetic_face_m1_n1.py +++ b/src/geovista/examples/from_1d__synthetic_face_m1_n1.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -38,7 +38,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, clim=(0, 1), cmap="ice", scalar_bar_args=sargs, show_edges=True diff --git a/src/geovista/examples/from_1d__synthetic_face_m1_n1_robin.py b/src/geovista/examples/from_1d__synthetic_face_m1_n1_robin.py index a4ec16f4..a000c57a 100755 --- a/src/geovista/examples/from_1d__synthetic_face_m1_n1_robin.py +++ b/src/geovista/examples/from_1d__synthetic_face_m1_n1_robin.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -40,7 +40,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=robin" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, clim=(0, 1), cmap="ice", scalar_bar_args=sargs, show_edges=True diff --git a/src/geovista/examples/from_1d__synthetic_node_m1_n1.py b/src/geovista/examples/from_1d__synthetic_node_m1_n1.py index 7656be44..c1be015e 100755 --- a/src/geovista/examples/from_1d__synthetic_node_m1_n1.py +++ b/src/geovista/examples/from_1d__synthetic_node_m1_n1.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -38,7 +38,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, clim=(0, 1), cmap="ice", scalar_bar_args=sargs, show_edges=True diff --git a/src/geovista/examples/from_1d__synthetic_node_m1_n1_moll.py b/src/geovista/examples/from_1d__synthetic_node_m1_n1_moll.py index 95f1542f..9c01dc6c 100755 --- a/src/geovista/examples/from_1d__synthetic_node_m1_n1_moll.py +++ b/src/geovista/examples/from_1d__synthetic_node_m1_n1_moll.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -40,7 +40,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=moll" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, diff --git a/src/geovista/examples/from_2d__orca.py b/src/geovista/examples/from_2d__orca.py index c0052e8c..dc55bd34 100755 --- a/src/geovista/examples/from_2d__orca.py +++ b/src/geovista/examples/from_2d__orca.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude curvilinear cell bounds. The resulting mesh contains quad cells. @@ -38,7 +38,7 @@ def main(off_screen: bool = False) -> None: mesh = mesh.threshold() # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_1()) diff --git a/src/geovista/examples/from_2d__orca_moll.py b/src/geovista/examples/from_2d__orca_moll.py index 5fde224d..2415fb21 100755 --- a/src/geovista/examples/from_2d__orca_moll.py +++ b/src/geovista/examples/from_2d__orca_moll.py @@ -17,7 +17,7 @@ from geovista.transform import transform_mesh -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude curvilinear cell bounds. The resulting mesh contains quad cells. @@ -51,7 +51,7 @@ def main(off_screen: bool = False) -> None: mesh.extrude((0, 0, -1000000), capping=True, inplace=True) # plot the mesh - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_coastlines(color="black") diff --git a/src/geovista/examples/from_2d__synthetic_face_m1n1.py b/src/geovista/examples/from_2d__synthetic_face_m1n1.py index 30a7adb5..bbf7a755 100755 --- a/src/geovista/examples/from_2d__synthetic_face_m1n1.py +++ b/src/geovista/examples/from_2d__synthetic_face_m1n1.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -39,7 +39,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the data - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, clim=(0, 1), cmap="tempo", scalar_bar_args=sargs, show_edges=True diff --git a/src/geovista/examples/from_2d__synthetic_face_m1n1_robin.py b/src/geovista/examples/from_2d__synthetic_face_m1n1_robin.py index 15badd9c..893923c6 100755 --- a/src/geovista/examples/from_2d__synthetic_face_m1n1_robin.py +++ b/src/geovista/examples/from_2d__synthetic_face_m1n1_robin.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -41,7 +41,7 @@ def main(off_screen: bool = False) -> None: # plot the data crs = "+proj=robin" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, clim=(0, 1), cmap="tempo", scalar_bar_args=sargs, show_edges=True diff --git a/src/geovista/examples/from_2d__synthetic_node_m1n1.py b/src/geovista/examples/from_2d__synthetic_node_m1n1.py index c8247f3b..5666eb27 100755 --- a/src/geovista/examples/from_2d__synthetic_node_m1n1.py +++ b/src/geovista/examples/from_2d__synthetic_node_m1n1.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -39,7 +39,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() plotter.add_mesh(mesh, clim=(0, 1), cmap="tempo", show_edges=True) plotter.add_coastlines() plotter.add_axes() diff --git a/src/geovista/examples/from_2d__synthetic_node_m1n1_moll.py b/src/geovista/examples/from_2d__synthetic_node_m1n1_moll.py index e6669601..1e3feadc 100755 --- a/src/geovista/examples/from_2d__synthetic_node_m1n1_moll.py +++ b/src/geovista/examples/from_2d__synthetic_node_m1n1_moll.py @@ -14,7 +14,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude rectilinear cell bounds. The resulting mesh contains quad cells. @@ -41,7 +41,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=moll" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{name} / 1", "shadow": True} plotter.add_mesh( mesh, diff --git a/src/geovista/examples/from_points__orca_cloud.py b/src/geovista/examples/from_points__orca_cloud.py index 0380514a..16270846 100755 --- a/src/geovista/examples/from_points__orca_cloud.py +++ b/src/geovista/examples/from_points__orca_cloud.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a point-cloud from 1-D latitude, longitude and z-levels. The resulting mesh contains only points. @@ -43,7 +43,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", cloud) # plot the point-cloud - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh( cloud, diff --git a/src/geovista/examples/from_points__orca_cloud_eqc.py b/src/geovista/examples/from_points__orca_cloud_eqc.py index c4fbac94..cbc78461 100755 --- a/src/geovista/examples/from_points__orca_cloud_eqc.py +++ b/src/geovista/examples/from_points__orca_cloud_eqc.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a point-cloud from 1-D latitude, longitude and z-levels. The resulting mesh contains only points. @@ -46,7 +46,7 @@ def main(off_screen: bool = False) -> None: # plot the point-cloud crs = "+proj=eqc" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh( cloud, diff --git a/src/geovista/examples/from_unstructured__fesom.py b/src/geovista/examples/from_unstructured__fesom.py index adad6237..95c0a85e 100755 --- a/src/geovista/examples/from_unstructured__fesom.py +++ b/src/geovista/examples/from_unstructured__fesom.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh is formed from masked connectivity, allowing the mesh to contain @@ -39,7 +39,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_hypsometric()) diff --git a/src/geovista/examples/from_unstructured__fesom_fouc.py b/src/geovista/examples/from_unstructured__fesom_fouc.py index b24f6d48..7517a251 100755 --- a/src/geovista/examples/from_unstructured__fesom_fouc.py +++ b/src/geovista/examples/from_unstructured__fesom_fouc.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh is formed from masked connectivity, allowing the mesh to contain @@ -45,7 +45,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=fouc" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} # require increased relative tolerance accuracy when cutting the mesh # at the anti-meridian due to its complex geometry diff --git a/src/geovista/examples/from_unstructured__fvcom.py b/src/geovista/examples/from_unstructured__fvcom.py index cd7541b0..c0653e92 100755 --- a/src/geovista/examples/from_unstructured__fvcom.py +++ b/src/geovista/examples/from_unstructured__fvcom.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains triangular cells. The connectivity is required to @@ -48,7 +48,7 @@ def main(off_screen: bool = False) -> None: mesh.warp_by_scalar(scalars="node", inplace=True, factor=2e-5) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh( mesh, cmap="deep", scalars="face", show_edges=True, scalar_bar_args=sargs diff --git a/src/geovista/examples/from_unstructured__icon.py b/src/geovista/examples/from_unstructured__icon.py index 962e6ab9..64cba346 100755 --- a/src/geovista/examples/from_unstructured__icon.py +++ b/src/geovista/examples/from_unstructured__icon.py @@ -15,7 +15,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh contains triangular cells. @@ -38,7 +38,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} cmap = mpl.colormaps.get_cmap("cet_CET_L17").resampled(lutsize=9) plotter.add_mesh(mesh, cmap=cmap, show_edges=True, scalar_bar_args=sargs) diff --git a/src/geovista/examples/from_unstructured__icon_eqc.py b/src/geovista/examples/from_unstructured__icon_eqc.py index 4fba0675..5f8d144d 100755 --- a/src/geovista/examples/from_unstructured__icon_eqc.py +++ b/src/geovista/examples/from_unstructured__icon_eqc.py @@ -15,7 +15,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh contains triangular cells. @@ -40,7 +40,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=eqc" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} cmap = mpl.colormaps.get_cmap("cet_CET_L17").resampled(lutsize=9) plotter.add_mesh(mesh, cmap=cmap, show_edges=True, scalar_bar_args=sargs) diff --git a/src/geovista/examples/from_unstructured__icosahedral.py b/src/geovista/examples/from_unstructured__icosahedral.py index 4f7f091f..7ec89b56 100755 --- a/src/geovista/examples/from_unstructured__icosahedral.py +++ b/src/geovista/examples/from_unstructured__icosahedral.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh contains 6-sided (hexagonal) cells. @@ -36,7 +36,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_coastlines() diff --git a/src/geovista/examples/from_unstructured__icosahedral_poly.py b/src/geovista/examples/from_unstructured__icosahedral_poly.py index 861f9077..63f1c851 100755 --- a/src/geovista/examples/from_unstructured__icosahedral_poly.py +++ b/src/geovista/examples/from_unstructured__icosahedral_poly.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh contains 6-sided (hexagonal) cells. @@ -38,7 +38,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=poly" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_coastlines() diff --git a/src/geovista/examples/from_unstructured__lam_pacific.py b/src/geovista/examples/from_unstructured__lam_pacific.py index 97587d6c..1a13582b 100755 --- a/src/geovista/examples/from_unstructured__lam_pacific.py +++ b/src/geovista/examples/from_unstructured__lam_pacific.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains quad cells and is constructed from CF UGRID unstructured @@ -41,7 +41,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_hypsometric()) diff --git a/src/geovista/examples/from_unstructured__lam_pacific_moll.py b/src/geovista/examples/from_unstructured__lam_pacific_moll.py index 5e43b0cf..773c68c7 100755 --- a/src/geovista/examples/from_unstructured__lam_pacific_moll.py +++ b/src/geovista/examples/from_unstructured__lam_pacific_moll.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains quad cells and is constructed from CF UGRID unstructured @@ -43,7 +43,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=moll" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_hypsometric()) diff --git a/src/geovista/examples/from_unstructured__lfric_orog.py b/src/geovista/examples/from_unstructured__lfric_orog.py index afc2cc0b..2d3341ff 100755 --- a/src/geovista/examples/from_unstructured__lfric_orog.py +++ b/src/geovista/examples/from_unstructured__lfric_orog.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains quad cells and is constructed from CF UGRID unstructured @@ -41,7 +41,7 @@ def main(off_screen: bool = False) -> None: gv.logger.info("%s", mesh) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_coastlines() diff --git a/src/geovista/examples/from_unstructured__lfric_orog_warp.py b/src/geovista/examples/from_unstructured__lfric_orog_warp.py index 40b05534..fa495dd3 100755 --- a/src/geovista/examples/from_unstructured__lfric_orog_warp.py +++ b/src/geovista/examples/from_unstructured__lfric_orog_warp.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains quad cells and is constructed from CF UGRID unstructured @@ -48,7 +48,7 @@ def main(off_screen: bool = False) -> None: mesh.warp_by_scalar(scalars=sample.name, inplace=True, factor=2e-5) # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs) plotter.add_axes() diff --git a/src/geovista/examples/from_unstructured__lfric_sst.py b/src/geovista/examples/from_unstructured__lfric_sst.py index 68480613..022e08a9 100755 --- a/src/geovista/examples/from_unstructured__lfric_sst.py +++ b/src/geovista/examples/from_unstructured__lfric_sst.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains quad cells and is constructed from CF UGRID unstructured @@ -44,7 +44,7 @@ def main(off_screen: bool = False) -> None: mesh = mesh.threshold() # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_1()) diff --git a/src/geovista/examples/from_unstructured__lfric_sst_bonne.py b/src/geovista/examples/from_unstructured__lfric_sst_bonne.py index 5127a6c3..816488e9 100755 --- a/src/geovista/examples/from_unstructured__lfric_sst_bonne.py +++ b/src/geovista/examples/from_unstructured__lfric_sst_bonne.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains quad cells and is constructed from CF UGRID unstructured @@ -46,7 +46,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=bonne +lat_1=10 +lon_0=180" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_1()) diff --git a/src/geovista/examples/from_unstructured__smc.py b/src/geovista/examples/from_unstructured__smc.py index a9028584..1676358a 100755 --- a/src/geovista/examples/from_unstructured__smc.py +++ b/src/geovista/examples/from_unstructured__smc.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh contains quad cells. @@ -38,7 +38,7 @@ def main(off_screen: bool = False) -> None: mesh = mesh.threshold() # plot the mesh - plotter = gv.GeoPlotter(off_screen=off_screen) + plotter = gv.GeoPlotter() sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_hypsometric()) diff --git a/src/geovista/examples/from_unstructured__smc_sinu.py b/src/geovista/examples/from_unstructured__smc_sinu.py index b96d657b..e32e4f08 100755 --- a/src/geovista/examples/from_unstructured__smc_sinu.py +++ b/src/geovista/examples/from_unstructured__smc_sinu.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 2-D latitude and longitude unstructured cell bounds. The resulting mesh contains quad cells. @@ -41,7 +41,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=sinu" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, scalar_bar_args=sargs) plotter.add_base_layer(texture=gv.natural_earth_hypsometric()) diff --git a/src/geovista/examples/from_unstructured__tri.py b/src/geovista/examples/from_unstructured__tri.py index 505ff3a7..ec265844 100755 --- a/src/geovista/examples/from_unstructured__tri.py +++ b/src/geovista/examples/from_unstructured__tri.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains triangular cells. The connectivity is required to diff --git a/src/geovista/examples/from_unstructured__tri_hammer.py b/src/geovista/examples/from_unstructured__tri_hammer.py index 92225801..2ab16b21 100755 --- a/src/geovista/examples/from_unstructured__tri_hammer.py +++ b/src/geovista/examples/from_unstructured__tri_hammer.py @@ -13,7 +13,7 @@ import geovista.theme # noqa: F401 -def main(off_screen: bool = False) -> None: +def main() -> None: """Create a mesh from 1-D latitude and longitude unstructured cell points. The resulting mesh contains triangular cells. The connectivity is required to @@ -46,7 +46,7 @@ def main(off_screen: bool = False) -> None: # plot the mesh crs = "+proj=hammer" - plotter = gv.GeoPlotter(crs=crs, off_screen=off_screen) + plotter = gv.GeoPlotter(crs=crs) sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True} plotter.add_mesh(mesh, show_edges=True, scalar_bar_args=sargs, scalars=sample.name) plotter.add_base_layer(texture=gv.natural_earth_hypsometric()) diff --git a/tests/plotting/test_examples.py b/tests/plotting/test_examples.py index 4f6a52d9..903a26d1 100644 --- a/tests/plotting/test_examples.py +++ b/tests/plotting/test_examples.py @@ -1,10 +1,14 @@ """Unit-test for :mod:`geovista.examples`.""" +import pyvista as pv + from geovista.examples import earthquakes +pv.OFF_SCREEN = True + def test_earthquakes(verify_image_cache): - """Image test of earthquakes examples.""" + """Image test of earthquakes example.""" verify_image_cache.high_variance_test = True verify_image_cache.var_error_value = 4470 - earthquakes.main(off_screen=True) + earthquakes.main()