import pytest

from compas.geometry import bounding_box_xy
from compas.geometry import bounding_box
from compas.geometry import oriented_bounding_box_xy_numpy
from compas.geometry import oriented_bounding_box_numpy


@pytest.mark.parametrize('coords,expected', [
    [[[0, 0], [1, 2], [-5, 6], [-3, 2], [0.5, -1]],
     [[-5, -1, 0.0], [1, -1, 0.0], [1, 6, 0.0], [-5, 6, 0.0]]],

    [[[6.74219, -53.57835], [6.74952, -53.57241], [6.75652, -53.56289], [6.74756, -53.56598], [6.73462, -53.57518]],
     [[6.73462, -53.57835, 0.0], [6.75652, -53.57835, 0.0], [6.75652, -53.56289, 0.0], [6.73462, -53.56289, 0.0]]]
])
def test_bounding_box_xy(coords, expected):
    assert expected == bounding_box_xy(coords)


@pytest.mark.parametrize('coords,expected', [
    [
        [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]],
        [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]]
    ]
])
def test_bounding_box(coords, expected):
    assert expected == bounding_box(coords)


@pytest.mark.parametrize('coords,expected', [
    [[[0, 0], [1, 2], [-5, 6], [-3, 2], [0.5, -1]],
     [[-6.129411764705883, 4.682352941176471], [0.5, -1.0], [2.1941176470588237, 0.976470588235294], [-4.435294117647059, 6.658823529411765]]],

    [[[6.74219, -53.57835], [6.74952, -53.57241], [6.75652, -53.56289], [6.74756, -53.56598], [6.73462, -53.57518]],
     [[6.754970846941253, -53.56071108254564], [6.73462, -53.57518], [6.738658767139154, -53.58086061378051], [6.759009614080408, -53.56639169632614]]]
])
def test_oriented_bounding_box_xy_numpy(coords, expected):
    print(oriented_bounding_box_xy_numpy(coords))
    assert expected == oriented_bounding_box_xy_numpy(coords)


@pytest.mark.parametrize('coords,expected', [
    [
        [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]],
        [
            [0.0, 0.0, 1.0], [0.0, 1.0, 0.0], [1.0, 0.5, -0.5], [1.0, -0.5, 0.5],
            [-0.3333333333333333, -0.3333333333333333, 0.6666666666666667], [-0.3333333333333333, 0.6666666666666667, -0.33333333333333326],
            [0.6666666666666667, 0.1666666666666667, -0.8333333333333333], [0.6666666666666667, -0.8333333333333333, 0.16666666666666674]
        ]
    ]
])
def test_oriented_bounding_box_numpy(coords, expected):
    print(oriented_bounding_box_numpy(coords).tolist())
    assert expected == oriented_bounding_box_numpy(coords).tolist()

@@ -36,31 +36,24 @@
  import 
-bounding_box_xy
+allclose
 %0Afrom co
@@ -86,16 +86,60 @@
 ing_box%0A
+from compas.geometry import bounding_box_xy%0A
 from com
@@ -176,27 +176,24 @@
 ounding_box_
-xy_
 numpy%0Afrom c
@@ -232,24 +232,27 @@
 ounding_box_
+xy_
 numpy%0A%0A%0A@pyt
@@ -1615,58 +1615,8 @@
 d):%0A
-    print(oriented_bounding_box_xy_numpy(coords))%0A
     
@@ -2235,14 +2235,18 @@
     
-print(
+results = 
 orie
@@ -2289,74 +2289,123 @@
 st()
-)
 %0A    
-assert expected == oriented_bounding_box_numpy(coords).tolist(
+for result, expected_values in zip(results, expected):%0A        assert allclose(result, expected_values, tol=1e-3
 )%0A

Fix test that fails due to floating point rounding