Skip to content

Commit 60f054a

Browse files
committed
test(mesh-filters): define test_repair.py
1 parent 7d55516 commit 60f054a

File tree

9 files changed

+107
-435
lines changed

9 files changed

+107
-435
lines changed

packages/mesh-filters/pixi.lock

Lines changed: 45 additions & 433 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mesh-filters/pixi.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ itkwasm-mesh-filters = { path = "python/itkwasm-mesh-filters", editable = true }
8686
pyodide-py = ">=0.26.3, <0.27"
8787
pytest-pyodide = ">=0.58.3, <0.59"
8888
itk-webassemblyinterface = ">=1.0b175, <2"
89-
itkwasm-image-io = ">=1.3.0, <2"
90-
itkwasm-compare-images = ">=5.2.3, <6"
89+
itkwasm-mesh-io = ">=1.6.2, <2"
90+
itkwasm-compare-meshes = ">=0.5.0, <1"
9191

9292
[feature.python.tasks.test-wasi]
9393
cmd = "pytest"

packages/mesh-filters/python/itkwasm-mesh-filters-wasi/tests/__init__.py

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from pathlib import Path
2+
3+
test_input_path = Path(__file__).parent / ".." / ".." / ".." / "test" / "data" / "input"
4+
test_baseline_path = Path(__file__).parent / ".." / ".." / ".." / "test" / "data" / "baseline"
5+
test_output_path = Path(__file__).parent / ".." / ".." / ".." / "test" / "data" / "output" / "python"
6+
test_output_path.mkdir(parents=True, exist_ok=True)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated file. To retain edits, remove this comment.
2+
3+
from itkwasm_mesh_filters_wasi import geogram_conversion
4+
5+
from .common import test_input_path, test_output_path
6+
7+
def test_geogram_conversion():
8+
pass
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated file. To retain edits, remove this comment.
2+
3+
from itkwasm_mesh_filters_wasi import keep_largest_component
4+
5+
from .common import test_input_path, test_output_path
6+
7+
def test_keep_largest_component():
8+
pass
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated file. To retain edits, remove this comment.
2+
3+
from itkwasm_mesh_filters_wasi import remesh
4+
5+
from .common import test_input_path, test_output_path
6+
7+
def test_remesh():
8+
pass
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from pathlib import Path
2+
3+
from itkwasm_mesh_io import read_mesh
4+
from itkwasm_compare_meshes import compare_meshes
5+
6+
from itkwasm_mesh_filters_wasi import repair
7+
8+
9+
from .common import test_input_path, test_baseline_path, test_output_path
10+
11+
def test_repair():
12+
input_mesh_path = test_input_path / "suzanne.off"
13+
input_mesh = read_mesh(input_mesh_path)
14+
15+
output_mesh = repair(input_mesh)
16+
17+
baseline_mesh_path = test_baseline_path / "suzanne-repair.iwm.cbor"
18+
baseline_mesh = read_mesh(baseline_mesh_path)
19+
20+
comparison = compare_meshes(output_mesh, baseline_meshes=[baseline_mesh])
21+
22+
assert comparison[0]['almostEqual']
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated file. To retain edits, remove this comment.
2+
3+
from itkwasm_mesh_filters_wasi import slice_mesh
4+
5+
from .common import test_input_path, test_output_path
6+
7+
def test_slice_mesh():
8+
pass

0 commit comments

Comments
 (0)