# Path: gridded/tests/test_ugrid/utilities.py
# @pytest.fixture
# def twenty_one_triangles():
#     """
#     Returns a basic triangular grid:  21 triangles, a hole, and a tail.
# 
#     """
#     nodes = [(5, 1),
#              (10, 1),
#              (3, 3),
#              (7, 3),
#              (9, 4),
#              (12, 4),
#              (5, 5),
#              (3, 7),
#              (5, 7),
#              (7, 7),
#              (9, 7),
#              (11, 7),
#              (5, 9),
#              (8, 9),
#              (11, 9),
#              (9, 11),
#              (11, 11),
#              (7, 13),
#              (9, 13),
#              (7, 15), ]
# 
#     faces = [(0, 1, 3),
#              (0, 6, 2),
#              (0, 3, 6),
#              (1, 4, 3),
#              (1, 5, 4),
#              (2, 6, 7),
#              (6, 8, 7),
#              (7, 8, 12),
#              (6, 9, 8),
#              (8, 9, 12),
#              (9, 13, 12),
#              (4, 5, 11),
#              (4, 11, 10),
#              (9, 10, 13),
#              (10, 11, 14),
#              (10, 14, 13),
#              (13, 14, 15),
#              (14, 16, 15),
#              (15, 16, 18),
#              (15, 18, 17),
#              (17, 18, 19), ]
# 
#     # We may want to use this later to define just the outer boundary.
#     boundaries = [(0, 1),
#                   (1, 5),
#                   (5, 11),
#                   (11, 14),
#                   (14, 16),
#                   (16, 18),
#                   (18, 19),
#                   (19, 17),
#                   (17, 15),
#                   (15, 13),
#                   (13, 12),
#                   (12, 7),
#                   (7, 2),
#                   (2, 0),
#                   (3, 4),
#                   (4, 10),
#                   (10, 9),
#                   (9, 6),
#                   (6, 3), ]
# 
#     grid = ugrid.UGrid(nodes=nodes, faces=faces, boundaries=boundaries)
#     grid.build_edges()
#     return grid


import numpy as np
import pytest
    import cell_tree2d  # noqa: ignore=F401
from .utilities import twenty_one_triangles


# used to parametrize tests for both methods
try:
    methods = ['simple', 'celltree']
except ImportError:
    # no cell tree -- only test simple
    methods = ['simple']


@pytest.mark.parametrize("method", methods)
def test_single(method, twenty_one_triangles):
    ugrid = twenty_one_triangles
    face = ugrid.locate_faces((4, 6.5), method)
    assert face == 6


@pytest.mark.parametrize("method", methods)
def test_multi(method, twenty_one_triangles):

# Path: gridded/tests/test_ugrid/utilities.py
# @pytest.fixture
# def twenty_one_triangles():
#     """
#     Returns a basic triangular grid:  21 triangles, a hole, and a tail.
# 
#     """
#     nodes = [(5, 1),
#              (10, 1),
#              (3, 3),
#              (7, 3),
#              (9, 4),
#              (12, 4),
#              (5, 5),
#              (3, 7),
#              (5, 7),
#              (7, 7),
#              (9, 7),
#              (11, 7),
#              (5, 9),
#              (8, 9),
#              (11, 9),
#              (9, 11),
#              (11, 11),
#              (7, 13),
#              (9, 13),
#              (7, 15), ]
# 
#     faces = [(0, 1, 3),
#              (0, 6, 2),
#              (0, 3, 6),
#              (1, 4, 3),
#              (1, 5, 4),
#              (2, 6, 7),
#              (6, 8, 7),
#              (7, 8, 12),
#              (6, 9, 8),
#              (8, 9, 12),
#              (9, 13, 12),
#              (4, 5, 11),
#              (4, 11, 10),
#              (9, 10, 13),
#              (10, 11, 14),
#              (10, 14, 13),
#              (13, 14, 15),
#              (14, 16, 15),
#              (15, 16, 18),
#              (15, 18, 17),
#              (17, 18, 19), ]
# 
#     # We may want to use this later to define just the outer boundary.
#     boundaries = [(0, 1),
#                   (1, 5),
#                   (5, 11),
#                   (11, 14),
#                   (14, 16),
#                   (16, 18),
#                   (18, 19),
#                   (19, 17),
#                   (17, 15),
#                   (15, 13),
#                   (13, 12),
#                   (12, 7),
#                   (7, 2),
#                   (2, 0),
#                   (3, 4),
#                   (4, 10),
#                   (10, 9),
#                   (9, 6),
#                   (6, 3), ]
# 
#     grid = ugrid.UGrid(nodes=nodes, faces=faces, boundaries=boundaries)
#     grid.build_edges()
#     return grid


# Path: gridded/tests/test_ugrid/test_locate_faces.py
import numpy as np
import pytest
    import cell_tree2d  # noqa: ignore=F401
from .utilities import twenty_one_triangles



# used to parametrize tests for both methods
try:
    methods = ['simple', 'celltree']
except ImportError:
    # no cell tree -- only test simple
    methods = ['simple']


@pytest.mark.parametrize("method", methods)
def test_single(method, twenty_one_triangles):
    ugrid = twenty_one_triangles
    face = ugrid.locate_faces((4, 6.5), method)
    assert face == 6


@pytest.mark.parametrize("method", methods)
def test_multi(method, twenty_one_triangles):

    ugrid = twenty_one_triangles