Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor themes #668

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ colormap.
```python
import geovista as gv
from geovista.pantry.data import ww3_global_tri
import geovista.theme
import geovista.themes

# Load the sample data.
sample = ww3_global_tri()
Expand Down Expand Up @@ -189,7 +189,7 @@ from an [FVCOM](http://fvcom.smast.umassd.edu/fvcom/) **unstructured** mesh, as
```python
import geovista as gv
from geovista.pantry.data import fvcom_tamar
import geovista.theme
import geovista.themes

# Load the sample data.
sample = fvcom_tamar()
Expand Down Expand Up @@ -240,7 +240,7 @@ base layer.
```python
import geovista as gv
from geovista.pantry.data import lam_pacific
import geovista.theme
import geovista.themes

# Load the sample data.
sample = lam_pacific()
Expand Down Expand Up @@ -284,7 +284,7 @@ import cartopy.crs as ccrs

import geovista as gv
from geovista.pantry.data import lam_pacific
import geovista.theme
import geovista.themes

# Load the sample data.
sample = lam_pacific()
Expand Down Expand Up @@ -326,7 +326,7 @@ Now render a [Met Office LFRic](https://www.metoffice.gov.uk/research/approach/m
```python
import geovista as gv
from geovista.pantry.data import lfric_sst
import geovista.theme
import geovista.themes

# Load the sample data.
sample = lfric_sst()
Expand Down Expand Up @@ -365,7 +365,7 @@ using Met Office Unified Model (UM) ORCA2 Sea Water Potential Temperature data,
```python
import geovista as gv
from geovista.pantry.data import um_orca2
import geovista.theme
import geovista.themes

# Load sample data.
sample = um_orca2()
Expand Down Expand Up @@ -403,7 +403,7 @@ Now let's render a [NOAA/NCEI Optimum Interpolation SST](https://www.ncei.noaa.g
```python
import geovista as gv
from geovista.pantry.data import oisst_avhrr_sst
import geovista.theme
import geovista.themes

# Load sample data.
sample = oisst_avhrr_sst()
Expand Down Expand Up @@ -443,7 +443,7 @@ model uses hexagonal and pentagonal cells, and is a new dynamical core for
```python
import geovista as gv
from geovista.pantry.data import dynamico
import geovista.theme
import geovista.themes

# Load sample data.
sample = dynamico()
Expand Down
9 changes: 8 additions & 1 deletion src/geovista/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@
except ModuleNotFoundError:
__version__ = "unknown"

#: flag when performing image testing
GEOVISTA_IMAGE_TESTING: bool = (
os.environ.get("GEOVISTA_IMAGE_TESTING", "false").lower() == "true"
)
"""Flag when performing image testing."""

if not GEOVISTA_IMAGE_TESTING:
# only load the geovista theme if we're not performing image testing,
# as the default pyvista testing theme is adopted instead
from .themes import _find_and_set_plot_theme

_find_and_set_plot_theme()
2 changes: 1 addition & 1 deletion src/geovista/examples/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

import geovista as gv
from geovista.pantry.data import cloud_amount
import geovista.theme
import geovista.themes

#: The colormap to render the clouds.
CMAP = cmocean.cm.gray
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/clouds_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

import geovista as gv
from geovista.pantry.data import cloud_amount
import geovista.theme
import geovista.themes

#: The colormap to render the clouds.
CMAP = cmocean.cm.gray
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/curvilinear/from_2d__orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import geovista as gv
from geovista.pantry.data import um_orca2
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/curvilinear/from_2d__orca_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import geovista as gv
from geovista.common import cast_UnstructuredGrid_to_PolyData as cast
from geovista.pantry.data import um_orca2
import geovista.theme
import geovista.themes
from geovista.transform import transform_mesh


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import geovista as gv
from geovista.pantry.data import um_orca2_gradient
from geovista.pantry.meshes import ZLEVEL_SCALE_CLOUD
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import geovista as gv
from geovista.pantry.data import um_orca2_gradient
from geovista.pantry.meshes import ZLEVEL_SCALE_CLOUD
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/rectilinear/from_1d__oisst.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import geovista as gv
from geovista.pantry.data import oisst_avhrr_sst
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/rectilinear/from_1d__oisst_eqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import geovista as gv
from geovista.pantry.data import oisst_avhrr_sst
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import numpy as np

import geovista as gv
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/scalar_data/earthquakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

import geovista as gv
from geovista.pantry.data import usgs_earthquakes
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/scalar_data/earthquakes_wink1.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

import geovista as gv
from geovista.pantry.data import usgs_earthquakes
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/spatial_index/uber_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

import geovista
from geovista.geodesic import line
import geovista.theme
import geovista.themes

# %%
# As a convenience, we create some **type aliases** and **data containers**
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/dynamico.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import geovista as gv
from geovista.pantry.data import dynamico
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/dynamico_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import geovista as gv
from geovista.pantry.data import dynamico
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/fesom.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import geovista as gv
from geovista.pantry.data import fesom
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/fesom_fouc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import geovista as gv
from geovista.pantry.data import fesom
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import geovista as gv
from geovista.pantry.data import icon_soil
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/icon_eqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import geovista as gv
from geovista.pantry.data import icon_soil
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/lam_pacific.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import geovista as gv
from geovista.pantry.data import lam_pacific
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/lam_pacific_moll.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import geovista as gv
from geovista.pantry.data import lam_pacific
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/lfric_sst.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import geovista as gv
from geovista.pantry.data import lfric_sst
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/lfric_sst_bonne.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import geovista as gv
from geovista.pantry.data import lfric_sst
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/smc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import geovista as gv
from geovista.pantry.data import ww3_global_smc
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/smc_sinu.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import geovista as gv
from geovista.pantry.data import ww3_global_smc
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/tri.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import geovista as gv
from geovista.pantry.data import ww3_global_tri
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/unstructured/tri_hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import geovista as gv
from geovista.pantry.data import ww3_global_tri
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/geovista/examples/vector_data/vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import geovista as gv
from geovista.pantry.meshes import regular_grid
import geovista.theme
import geovista.themes


def main() -> None:
Expand Down
Loading
Loading