示例#1
0
文件: test_init.py 项目: parkin/pymdt
    def test_parse_array_assignment_zeros(self):
        line = 'Map = zeros(3,3,2);'

        arr = _parse_array_assignment(line)

        arr_should_be = np.zeros((3,3,2))
        np.testing.assert_array_equal(arr, arr_should_be)
示例#2
0
文件: test_init.py 项目: parkin/pymdt
    def test_parse_array_assignment_2d(self):
        line = 'Map = [1.0 2.0 ;3.0 4.0 ];'

        arr = _parse_array_assignment(line)

        arr_should_be = np.array([[1.0, 2.0], [3.0, 4.0]])
        np.testing.assert_array_almost_equal(arr, arr_should_be)