Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed Nov 23, 2023
1 parent 3669486 commit 182330e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ build-backend = "setuptools.build_meta"
test-requires = "pytest"
test-command = "pytest {project}/tests"

# Skip CPython 3.7 and PyPy wheels
skip = ["cp37-*", "pp*"]
# skip PyPy wheels
skip = ["pp*"]
25 changes: 19 additions & 6 deletions tests/test_metaball_icosahedron.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pytessel import PyTessel
import numpy as np
import sys, os
import platform

# add a reference to load the pytessel library
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
Expand All @@ -15,12 +16,24 @@ def test_isosurface_icosahedron(self):
"""
pytessel = PyTessel()

results = [
[200,200,1128],
[1312,1312,7896],
[2168,2168,12960],
[9224,9224,55224],
]
# the test results differ for 64 bit OS and 32 bit OS (due to rounding errors in the scalar field)
# the cause of this is mainly due to assessing when two vertices are alike, for 32 bit OS
# the threshold is met sooner leading to fewer vertices; the number of triangles is however conserved
# between 32 and 64 bit OS
if platform.machine().endswith('64'):
results = [
[200,200,1128],
[1312,1312,7896],
[2168,2168,12960],
[9224,9224,55224],
]
else:
results = [
[192,192,1128],
[1296,1296,7896],
[2124,2124,12960],
[9168,9168,55224],
]

for nrpoints, result in zip([10,20,25,50], results):
sz = 3
Expand Down

0 comments on commit 182330e

Please sign in to comment.