Skip to content

Commit

Permalink
revert examples off_screen kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle committed Sep 27, 2023
1 parent 7bbd746 commit 5fd1be9
Show file tree
Hide file tree
Showing 36 changed files with 75 additions and 71 deletions.
4 changes: 2 additions & 2 deletions src/geovista/examples/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/clouds_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/earthquakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/earthquakes_wink1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_1d__oisst.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_1d__oisst_eqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_1d__synthetic_face_m1_n1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_1d__synthetic_face_m1_n1_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_1d__synthetic_node_m1_n1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_1d__synthetic_node_m1_n1_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_2d__orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_2d__orca_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_2d__synthetic_face_m1n1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_2d__synthetic_face_m1n1_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_2d__synthetic_node_m1n1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_2d__synthetic_node_m1n1_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_points__orca_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_points__orca_cloud_eqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_unstructured__fesom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_unstructured__fesom_fouc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_unstructured__fvcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/geovista/examples/from_unstructured__icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
Loading

0 comments on commit 5fd1be9

Please sign in to comment.