Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expect failures due to numerical precision in miniball. #183

Merged
merged 7 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/test_polyhedron.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def test_insphere_catalan(poly):
)

# The insphere of a catalan solid should be rotation invariant.
@settings(deadline=1200)
@settings(deadline=5000)
@given(Random3DRotationStrategy)
def check_rotation_invariance(quat):
rotated_poly = ConvexPolyhedron(rowan.rotate(quat, poly.vertices))
Expand Down Expand Up @@ -712,6 +712,12 @@ def test_form_factor(cube):
named_prismantiprism_mark,
named_pyramiddipyramid_mark,
)
@pytest.mark.xfail(
reason=(
"Numerical precision problems with miniball. "
"See https://github.com/glotzerlab/coxeter/issues/179"
)
)
def test_get_set_minimal_bounding_sphere_radius(poly):
_test_get_set_minimal_bounding_sphere_radius(poly)

Expand Down
4 changes: 3 additions & 1 deletion tests/test_spheropolyhedron.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This software is licensed under the BSD 3-Clause License.
import numpy as np
import pytest
from hypothesis import given
from hypothesis import given, settings
from hypothesis.strategies import floats
from pytest import approx

Expand Down Expand Up @@ -33,6 +33,7 @@ def test_set_volume(value):
assert sphero_cube.volume == approx(value)


@settings(deadline=1000)
@given(radius=floats(0.1, 1))
def test_surface_area(radius):
sphero_cube = make_sphero_cube(radius=radius)
Expand Down Expand Up @@ -69,6 +70,7 @@ def test_invalid_radius(r):
make_sphero_cube(radius=r)


@settings(deadline=1000)
@given(r=floats(-1000, -1))
def test_invalid_radius_setter(r):
sphero_cube = make_sphero_cube(1)
Expand Down