From: Gilles DAVID Date: Wed, 19 Apr 2017 11:42:40 +0000 (+0200) Subject: Ne pas remplacer XX.sort() par sorted(XXX) pour les classes MEDCoupling ! X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66d94f6a4200c7d4108988bb0fed1891179ff324;p=tools%2Fmedcoupling.git Ne pas remplacer XX.sort() par sorted(XXX) pour les classes MEDCoupling ! --- diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py index d32171834..7d7799c9e 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py @@ -2702,7 +2702,8 @@ class MEDCouplingBasicsTest1(unittest.TestCase): types=mesh.getAllGeoTypes(); types.sort() self.assertEqual(5,len(types)); - expected1=sorted([NORM_POLYGON, NORM_TRI3, NORM_QUAD4, NORM_TRI6, NORM_QUAD8]) + expected1 = [NORM_POLYGON, NORM_TRI3, NORM_QUAD4, NORM_TRI6, NORM_QUAD8] + expected1.sort() self.assertEqual(expected1,types); self.assertTrue(mesh.isPresenceOfQuadratic()); self.assertEqual(62,mesh.getNodalConnectivityArrayLen()); diff --git a/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py b/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py index 031143bd5..3d14d550c 100644 --- a/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py +++ b/src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py @@ -107,7 +107,8 @@ mesh3D.getCoords()[:]*=100. mesh3D.getCoords().setInfoOnComponents(["X [cm]","Y [cm]","Z [cm]"]) # zLev=mesh3D.getCoords()[:,2] -zLev=sorted(zLev.getDifferentValues(1e-12)) +zLev = zLev.getDifferentValues(1e-12) +zLev.sort() # tmp,cellIdsSol1=mesh3D.buildSlice3D([0.,0.,(zLev[1]+zLev[2])/2],[0.,0.,1.],1e-12) bary=mesh3D.computeCellCenterOfMass()