X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FUsersGuideExamplesTest_numpy.py;h=bc5863611e05f6a4cff8228f9987754ad9ae4be0;hb=f7fdff591a1830181499ba95e16ef25eb43e0140;hp=ad566904a9bd0928b70e39dcbc001ae6cbf4f531;hpb=e057263132f3cb4871fb280f8d9c963ba17567a1;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/UsersGuideExamplesTest_numpy.py b/src/MEDCoupling_Swig/UsersGuideExamplesTest_numpy.py index ad566904a..bc5863611 100644 --- a/src/MEDCoupling_Swig/UsersGuideExamplesTest_numpy.py +++ b/src/MEDCoupling_Swig/UsersGuideExamplesTest_numpy.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# Copyright (C) 2007-2020 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 @@ -17,17 +17,25 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +import sys +if sys.platform == "win32": + from MEDCouplingCompat import * +else: + from medcoupling import * -from MEDCoupling import * from math import pi, sqrt import numpy -import MEDCoupling +if sys.platform == "win32": + import MEDCouplingCompat as MEDCoupling +else: + import MEDCoupling + #! [UG_DataArrayNumpy_0] # NumPy is an optional pre-requisite! assert(MEDCoupling.MEDCouplingHasNumPyBindings()) a=numpy.arange(20,dtype=numpy.int32) -d=DataArrayInt(a) # d owns data of a -e=DataArrayInt(a) # a not owned -> e only an access to chunk of a +d=DataArrayInt32(a) # d owns data of a +e=DataArrayInt32(a) # a not owned -> e only an access to chunk of a a1=d.toNumPyArray() #! [UG_DataArrayNumpy_0]