-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
57 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Unit-test for :func:`geovista.crs.has_wkt`.""" | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
from geovista.crs import has_wkt | ||
|
||
|
||
@pytest.mark.parametrize("mesh, expected", [("sphere", False), ("lfric", True)]) | ||
def test(mesh, expected, request): | ||
"""Test mesh wkt serialization availability.""" | ||
mesh = request.getfixturevalue(mesh) | ||
result = has_wkt(mesh) | ||
assert result is expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
"""Unit-tests for :func:`geovista.crs.to_wkt`.""" | ||
from __future__ import annotations | ||
|
||
import pyvista as pv | ||
|
||
from geovista.common import GV_FIELD_CRS | ||
from geovista.crs import WGS84, from_wkt, to_wkt | ||
|
||
|
||
def test(): | ||
def test(sphere): | ||
"""Test OGC WKT serialization of CRS on mesh.""" | ||
mesh = pv.Sphere() | ||
crs = WGS84 | ||
to_wkt(mesh, crs) | ||
assert GV_FIELD_CRS in mesh.field_data | ||
to_wkt(sphere, crs) | ||
assert GV_FIELD_CRS in sphere.field_data | ||
wkt = WGS84.to_wkt() | ||
assert mesh.field_data[GV_FIELD_CRS] == wkt | ||
assert from_wkt(mesh) == WGS84 | ||
assert sphere.field_data[GV_FIELD_CRS] == wkt | ||
assert from_wkt(sphere) == WGS84 |