# Path: simphony/cuds/primitive_cell.py
# class BravaisLattice(IntEnum):
#     """The 3D Bravais lattices"""
#     CUBIC = 0
#     BODY_CENTERED_CUBIC = 1
#     FACE_CENTERED_CUBIC = 2
#     RHOMBOHEDRAL = 3
#     TETRAGONAL = 4
#     BODY_CENTERED_TETRAGONAL = 5
#     HEXAGONAL = 6
#     ORTHORHOMBIC = 7
#     BODY_CENTERED_ORTHORHOMBIC = 8
#     FACE_CENTERED_ORTHORHOMBIC = 9
#     BASE_CENTERED_ORTHORHOMBIC = 10
#     MONOCLINIC = 11
#     BASE_CENTERED_MONOCLINIC = 12
#     TRICLINIC = 13


from itertools import permutations, combinations, product
from ..cuds.primitive_cell import BravaisLattice
import numpy
    else:
        return False


def find_lattice_type(p1, p2, p3, tolerance=1.e-6):
    ''' Return the lattice type as BravaisLattice(IntEnum)
    given a set of primitive vectors

    Numerical errors are tolerated within ``tolerance``

    Parameters
    ----------
    p1, p2, p3 : 3 x float[3]
        primitive vectors
    tolerance: float
        tolerance for numerical errors

    Returns
    -------
    BravaisLattice(IntEnum)

    Raises
    ------
    TypeError
        if none of the predefined BravaisLattice matches
        the given primitive vectors
    '''
    # Should be ordered from the most specific lattice
    # to the most general ones
    if is_cubic_lattice(p1, p2, p3, tolerance):

# Path: simphony/cuds/primitive_cell.py
# class BravaisLattice(IntEnum):
#     """The 3D Bravais lattices"""
#     CUBIC = 0
#     BODY_CENTERED_CUBIC = 1
#     FACE_CENTERED_CUBIC = 2
#     RHOMBOHEDRAL = 3
#     TETRAGONAL = 4
#     BODY_CENTERED_TETRAGONAL = 5
#     HEXAGONAL = 6
#     ORTHORHOMBIC = 7
#     BODY_CENTERED_ORTHORHOMBIC = 8
#     FACE_CENTERED_ORTHORHOMBIC = 9
#     BASE_CENTERED_ORTHORHOMBIC = 10
#     MONOCLINIC = 11
#     BASE_CENTERED_MONOCLINIC = 12
#     TRICLINIC = 13


# Path: simphony/tools/lattice_tools.py
from itertools import permutations, combinations, product
from ..cuds.primitive_cell import BravaisLattice
import numpy

    else:
        return False


def find_lattice_type(p1, p2, p3, tolerance=1.e-6):
    ''' Return the lattice type as BravaisLattice(IntEnum)
    given a set of primitive vectors

    Numerical errors are tolerated within ``tolerance``

    Parameters
    ----------
    p1, p2, p3 : 3 x float[3]
        primitive vectors
    tolerance: float
        tolerance for numerical errors

    Returns
    -------
    BravaisLattice(IntEnum)

    Raises
    ------
    TypeError
        if none of the predefined BravaisLattice matches
        the given primitive vectors
    '''
    # Should be ordered from the most specific lattice
    # to the most general ones
    if is_cubic_lattice(p1, p2, p3, tolerance):

        return BravaisLattice.CUBIC