Skip to content

Commit

Permalink
fix generate images (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Dec 23, 2023
1 parent 329ccbf commit 64f15e7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions data/tests/images/generate_images.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
"""Generate test images."""
import importlib
from pathlib import Path
import pkgutil
import shutil

import pyvista as pv
from pytest_pyvista import VerifyImageCache

import geovista as gv
from geovista.common import get_modules
import geovista.examples
from geovista.report import Report


SCRIPTS = sorted(
[submodule.name for submodule in pkgutil.iter_modules(gv.examples.__path__)]
)
EXAMPLES = get_modules("geovista.examples")

pv.global_theme.load_theme(pv.plotting.themes._TestingTheme())
pv.OFF_SCREEN = True
gv.GEOVISTA_IMAGE_TESTING = True

n_scripts: int = len(SCRIPTS)
n_scripts: int = len(EXAMPLES)
width: int = len(str(n_scripts))

cache_dir = Path(__file__).parent.resolve() / "image_cache"
Expand All @@ -31,7 +29,7 @@

print(f'\nGenerating {n_scripts} test images in "{cache_dir} ...')

for i, script in enumerate(SCRIPTS):
for i, script in enumerate(EXAMPLES):
print(
f'[{i+1:0{width}d}/{n_scripts}] Generating image for "{script}" example ... ',
end="",
Expand Down

0 comments on commit 64f15e7

Please sign in to comment.