|
1 |
| -import os |
| 1 | +import sys |
2 | 2 |
|
3 |
| -import geopandas as gp |
4 | 3 | import numpy as np
|
5 |
| -import pyposeidon.mesh as pmesh |
6 | 4 | import pytest
|
7 | 5 |
|
| 6 | +import pyposeidon.mesh as pmesh |
8 | 7 | from . import DATA_DIR
|
9 | 8 |
|
10 | 9 | DEM_FILE = (DATA_DIR / "dem.nc").as_posix()
|
11 | 10 |
|
12 | 11 | COAST_FILE = (DATA_DIR / "ocean.parquet").as_posix()
|
13 | 12 |
|
14 | 13 |
|
15 |
| -@pytest.mark.parametrize("ggor", ["jigsaw", "gmsh"]) |
16 |
| -@pytest.mark.parametrize("bgmesh", [None, DEM_FILE]) |
17 |
| -@pytest.mark.parametrize("bindings", [True, False]) |
| 14 | +@pytest.mark.parametrize("mesh_generator,use_bindings", [("jigsaw", None), ("gmsh", True), ("gmsh", False)]) |
| 15 | +@pytest.mark.parametrize("dem_source", [None, DEM_FILE]) |
18 | 16 | @pytest.mark.parametrize("cbuffer", [None, 0.01])
|
19 |
| -def test_io(pytestconfig, tmpdir, ggor, bgmesh, bindings, cbuffer): |
| 17 | +def test_io(pytestconfig, tmpdir, mesh_generator, use_bindings, dem_source, cbuffer): |
20 | 18 | # Skip the test unless --runslow has been passed
|
21 |
| - if bgmesh is not None: |
| 19 | + if dem_source is not None: |
22 | 20 | if not pytestconfig.getoption("--runslow"):
|
23 | 21 | pytest.skip("slow test")
|
24 | 22 |
|
| 23 | + if mesh_generator == "jigsaw" and cbuffer is not None and sys.platform != "darwin": |
| 24 | + pytest.xfail("jigsaw + buffer is failing on linux: https://github.com/ec-jrc/pyPoseidon/issues/196") |
| 25 | + |
25 | 26 | mesh = pmesh.set(
|
26 | 27 | type="tri2d",
|
27 | 28 | geometry="global",
|
28 | 29 | coastlines=COAST_FILE,
|
29 | 30 | rpath=str(tmpdir) + "/",
|
30 |
| - mesh_generator=ggor, |
31 |
| - dem_source=bgmesh, |
32 |
| - use_bindings=bindings, |
| 31 | + mesh_generator=mesh_generator, |
| 32 | + dem_source=dem_source, |
| 33 | + use_bindings=use_bindings, |
33 | 34 | cbuffer=cbuffer,
|
34 | 35 | )
|
35 | 36 |
|
@@ -58,28 +59,25 @@ def test_io(pytestconfig, tmpdir, ggor, bgmesh, bindings, cbuffer):
|
58 | 59 |
|
59 | 60 |
|
60 | 61 | @pytest.mark.schism
|
61 |
| -@pytest.mark.parametrize("ggor", ["jigsaw", "gmsh"]) |
62 |
| -@pytest.mark.parametrize("bgmesh", [None, DEM_FILE]) |
63 |
| -@pytest.mark.parametrize("bindings", [True, False]) |
| 62 | +@pytest.mark.parametrize("mesh_generator,use_bindings", [("jigsaw", None), ("gmsh", True), ("gmsh", False)]) |
| 63 | +@pytest.mark.parametrize("dem_source", [None, DEM_FILE]) |
64 | 64 | @pytest.mark.parametrize("cbuffer", [None, 0.01])
|
65 |
| -def test_validate(pytestconfig, tmpdir, ggor, cbuffer, bgmesh, bindings): |
66 |
| - if bgmesh is not None: |
| 65 | +def test_validate(pytestconfig, tmpdir, mesh_generator, use_bindings, dem_source, cbuffer): |
| 66 | + if dem_source is not None: |
67 | 67 | if not pytestconfig.getoption("--runslow"):
|
68 | 68 | pytest.skip("slow test")
|
69 |
| - if ggor == "jigsaw": |
70 |
| - pytest.xfail("Fixing these is a WIP") |
71 | 69 |
|
72 |
| - # if ggor == "jigsaw": |
73 |
| - # pytest.xfail("Fixing these is a WIP") |
| 70 | + if mesh_generator == "jigsaw" and cbuffer is not None and sys.platform != "darwin": |
| 71 | + pytest.xfail("jigsaw + buffer is failing on linux: https://github.com/ec-jrc/pyPoseidon/issues/196") |
74 | 72 |
|
75 | 73 | mesh = pmesh.set(
|
76 | 74 | type="tri2d",
|
77 | 75 | geometry="global",
|
78 | 76 | coastlines=COAST_FILE,
|
79 | 77 | rpath=str(tmpdir) + "/",
|
80 |
| - mesh_generator=ggor, |
81 |
| - dem_source=bgmesh, |
82 |
| - use_bindings=bindings, |
| 78 | + mesh_generator=mesh_generator, |
| 79 | + dem_source=dem_source, |
| 80 | + use_bindings=use_bindings, |
83 | 81 | cbuffer=cbuffer,
|
84 | 82 | )
|
85 | 83 |
|
|
0 commit comments