def test__H__set_w_numpyarray(): cell = SimulationCell() cell.H = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) np.testing.assert_array_equal(cell.h1, np.array([1, 4, 7])) np.testing.assert_array_equal(cell.h2, np.array([2, 5, 8])) np.testing.assert_array_equal(cell.h3, np.array([3, 6, 9]))
def test__h3__set_w_list(): cell = SimulationCell() cell.H = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] cell.h3 = [7, 8, 9] np.testing.assert_array_equal(cell.h1, np.array([1, 4, 7])) np.testing.assert_array_equal(cell.h2, np.array([2, 5, 8])) np.testing.assert_array_equal(cell.h3, np.array([7, 8, 9]))