X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingRemapperTest.py;h=90ac69ffb50717e12b09502b8737c3eebe1abffd;hb=1123dccd6613b2e8abba35182759d5c4a11ecc8d;hp=9c463ca08e3b7710fa094977c2f84801de8e8dd5;hpb=96810b67a9576d767939da2fb191330f3bf11008;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py b/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py index 9c463ca08..90ac69ffb 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingRemapperTest.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D +# Copyright (C) 2007-2014 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 @@ -591,7 +591,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): def testGetCrudeCSRMatrix1(self): """ testing CSR matrix output using numpy/scipy. """ - from scipy.sparse import diags + from scipy.sparse import spdiags #diags import scipy from numpy import array arr=DataArrayDouble(3) ; arr.iota() @@ -620,7 +620,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertEqual(diff.getnnz(),0) # IntegralGlobConstraint (division by sum of cols) colSum=m.sum(axis=0) - m_0=m*diags(array(1/colSum),[0]) + # version 0.12.0 # m_0=m*diags(array(1/colSum),[0]) + m_0=m*spdiags(array(1/colSum),[0],colSum.shape[1],colSum.shape[1]) del colSum self.assertAlmostEqual(m_0[0,0],0.625,12) self.assertAlmostEqual(m_0[1,0],0.25,12) @@ -632,7 +633,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertEqual(m_0.getnnz(),7) # ConservativeVolumic (division by sum of rows) rowSum=m.sum(axis=1) - m_1=diags(array(1/rowSum.transpose()),[0])*m + # version 0.12.0 # m_1=diags(array(1/rowSum.transpose()),[0])*m + m_1=spdiags(array(1/rowSum.transpose()),[0],rowSum.shape[0],rowSum.shape[0])*m del rowSum self.assertAlmostEqual(m_1[0,0],1.,12) self.assertAlmostEqual(m_1[1,0],0.4,12)