Skip to content

Commit

Permalink
test: xfail jigsaw + buffering
Browse files Browse the repository at this point in the history
Reference: #196
  • Loading branch information
pmav99 committed Aug 22, 2024
1 parent eec19e4 commit d7a28cd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
6 changes: 3 additions & 3 deletions tests/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@


@WINDOWS
@pytest.mark.parametrize("ggor", ["jigsaw", "gmsh"])
def test_answer(tmpdir, window, ggor):
@pytest.mark.parametrize("mesh_generator", ["jigsaw", "gmsh"])
def test_answer(tmpdir, window, mesh_generator):
mesh = pmesh.set(
type="tri2d",
geometry=window,
coastlines=COAST_FILE,
rpath=str(tmpdir) + "/",
mesh_generator=ggor,
mesh_generator=mesh_generator,
)

check = np.isnan(mesh.Dataset.depth.values).sum() == 0
Expand Down
44 changes: 21 additions & 23 deletions tests/test_mesh_global.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
import os
import sys

import geopandas as gp
import numpy as np
import pyposeidon.mesh as pmesh
import pytest

import pyposeidon.mesh as pmesh
from . import DATA_DIR

DEM_FILE = (DATA_DIR / "dem.nc").as_posix()

COAST_FILE = (DATA_DIR / "ocean.parquet").as_posix()


@pytest.mark.parametrize("ggor", ["jigsaw", "gmsh"])
@pytest.mark.parametrize("bgmesh", [None, DEM_FILE])
@pytest.mark.parametrize("bindings", [True, False])
@pytest.mark.parametrize("mesh_generator,use_bindings", [("jigsaw", None), ("gmsh", True), ("gmsh", False)])
@pytest.mark.parametrize("dem_source", [None, DEM_FILE])
@pytest.mark.parametrize("cbuffer", [None, 0.01])
def test_io(pytestconfig, tmpdir, ggor, bgmesh, bindings, cbuffer):
def test_io(pytestconfig, tmpdir, mesh_generator, use_bindings, dem_source, cbuffer):
# Skip the test unless --runslow has been passed
if bgmesh is not None:
if dem_source is not None:
if not pytestconfig.getoption("--runslow"):
pytest.skip("slow test")

if mesh_generator == "jigsaw" and cbuffer is not None and sys.platform != "darwin":
pytest.xfail("jigsaw + buffer is failing on linux: https://github.com/ec-jrc/pyPoseidon/issues/196")

mesh = pmesh.set(
type="tri2d",
geometry="global",
coastlines=COAST_FILE,
rpath=str(tmpdir) + "/",
mesh_generator=ggor,
dem_source=bgmesh,
use_bindings=bindings,
mesh_generator=mesh_generator,
dem_source=dem_source,
use_bindings=use_bindings,
cbuffer=cbuffer,
)

Expand Down Expand Up @@ -58,28 +59,25 @@ def test_io(pytestconfig, tmpdir, ggor, bgmesh, bindings, cbuffer):


@pytest.mark.schism
@pytest.mark.parametrize("ggor", ["jigsaw", "gmsh"])
@pytest.mark.parametrize("bgmesh", [None, DEM_FILE])
@pytest.mark.parametrize("bindings", [True, False])
@pytest.mark.parametrize("mesh_generator,use_bindings", [("jigsaw", None), ("gmsh", True), ("gmsh", False)])
@pytest.mark.parametrize("dem_source", [None, DEM_FILE])
@pytest.mark.parametrize("cbuffer", [None, 0.01])
def test_validate(pytestconfig, tmpdir, ggor, cbuffer, bgmesh, bindings):
if bgmesh is not None:
def test_validate(pytestconfig, tmpdir, mesh_generator, use_bindings, dem_source, cbuffer):
if dem_source is not None:
if not pytestconfig.getoption("--runslow"):
pytest.skip("slow test")
if ggor == "jigsaw":
pytest.xfail("Fixing these is a WIP")

# if ggor == "jigsaw":
# pytest.xfail("Fixing these is a WIP")
if mesh_generator == "jigsaw" and cbuffer is not None and sys.platform != "darwin":
pytest.xfail("jigsaw + buffer is failing on linux: https://github.com/ec-jrc/pyPoseidon/issues/196")

mesh = pmesh.set(
type="tri2d",
geometry="global",
coastlines=COAST_FILE,
rpath=str(tmpdir) + "/",
mesh_generator=ggor,
dem_source=bgmesh,
use_bindings=bindings,
mesh_generator=mesh_generator,
dem_source=dem_source,
use_bindings=use_bindings,
cbuffer=cbuffer,
)

Expand Down

0 comments on commit d7a28cd

Please sign in to comment.