Salome HOME
Pickelization of (squashed merge of agy/PyPickelingOfMCObj) :
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingNumPyTest.py
index b510668eab27313b0c5f54742376f356c6c68ec4..e5d7943bf1531970fb5d94b28e9c0a2626e29642 100644 (file)
@@ -1,10 +1,10 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -656,6 +656,14 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         self.assertEqual(a2.tolist(),[[0.,1.,2.],[3.,4.,5.],[6.,7.,8.],[9.,10.,11.],[12.,13.,14.]])
         pass
 
+    @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+    def test27(self):
+        m0=DenseMatrix(DataArrayDouble([2,3,4,5,1,6]),2,3)
+        m0np=m0.toNumPyMatrix()
+        self.assertEqual(m0np.shape,(2,3))
+        self.assertEqual(m0np.tolist(),[[2.0,3.0,4.0],[5.0,1.0,6.0]])
+        pass
+
     def setUp(self):
         pass
     pass