# Path: mpinterfaces/transformations.py
# def get_uv(ab, t_mat):
#     """
#     Return u and v, the supercell lattice vectors obtained through the
#     transformation matrix
#     """
#     u = np.array(ab[0]) * t_mat[0][0] + np.array(ab[1]) * t_mat[0][1]
#     v = np.array(ab[1]) * t_mat[1][1]
#     return [u, v]


import unittest
from mpinterfaces.transformations import get_uv
""" tests for mpinterfaces.transformations """

from __future__ import unicode_literals



__author__ = "Seve G. Monahan"
__copyright__ = "Copyright 2017, Henniggroup"
__maintainer__ = "Joshua J. Gabriel"
__email__ = "joshgabriel92@gmail.com"
__status__ = "Production"
__date__ = "March 3, 2017"


class TestGetUV(unittest.TestCase):

    def test_uv_1_1(self):
        self.assertEqual([1, 1], get_uv([1, 1], [[1, 0], [0, 1]]))

    def test_uv_2_2(self):
        self.assertEqual([2, 2], get_uv([1, 1], [[2, 0], [0, 2]]))

    def test_uv_2_1(self):
        self.assertEqual([2, 1], get_uv([1, 1], [[2, 0], [0, 1]]))

    def test_uv_addition(self):

# Path: mpinterfaces/transformations.py
# def get_uv(ab, t_mat):
#     """
#     Return u and v, the supercell lattice vectors obtained through the
#     transformation matrix
#     """
#     u = np.array(ab[0]) * t_mat[0][0] + np.array(ab[1]) * t_mat[0][1]
#     v = np.array(ab[1]) * t_mat[1][1]
#     return [u, v]


# Path: mpinterfaces/tests/test_get_uv.py
import unittest
from mpinterfaces.transformations import get_uv

""" tests for mpinterfaces.transformations """

from __future__ import unicode_literals



__author__ = "Seve G. Monahan"
__copyright__ = "Copyright 2017, Henniggroup"
__maintainer__ = "Joshua J. Gabriel"
__email__ = "joshgabriel92@gmail.com"
__status__ = "Production"
__date__ = "March 3, 2017"


class TestGetUV(unittest.TestCase):

    def test_uv_1_1(self):
        self.assertEqual([1, 1], get_uv([1, 1], [[1, 0], [0, 1]]))

    def test_uv_2_2(self):
        self.assertEqual([2, 2], get_uv([1, 1], [[2, 0], [0, 2]]))

    def test_uv_2_1(self):
        self.assertEqual([2, 1], get_uv([1, 1], [[2, 0], [0, 1]]))

    def test_uv_addition(self):

        self.assertEqual([5, 3], get_uv([2, 3], [[1, 1], [0, 1]]))