From 864bd9dad041b83237cb0292a0abf62747d55a1d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 16 Mar 2015 12:05:21 +0100 Subject: [PATCH] Update all the swig files to deal with __new__. --- src/MEDCoupling_Swig/MEDCouplingRemapper.i | 31 +++++++- src/MEDLoader/Swig/MEDLoader.i | 43 ++++++---- src/RENUMBER_Swig/MEDRenumber.i | 91 ++++++++++++---------- 3 files changed, 109 insertions(+), 56 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingRemapper.i b/src/MEDCoupling_Swig/MEDCouplingRemapper.i index b1c082cab..09881b239 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRemapper.i +++ b/src/MEDCoupling_Swig/MEDCouplingRemapper.i @@ -104,8 +104,8 @@ namespace ParaMEDMEM %pythoncode %{ def ParaMEDMEMDataArrayDoublenew(cls,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDouble____new___(cls,args) + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DataArrayDouble____new___(cls,args) def ParaMEDMEMDataArrayDoubleIadd(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DataArrayDouble____iadd___(self, self, *args) @@ -136,6 +136,9 @@ def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.MEDCouplingFieldDouble____ipow___(self, self, *args) +def ParaMEDMEMDataArrayIntnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.DataArrayInt____new___(cls,args) def ParaMEDMEMDataArrayIntnew(cls,*args): import _MEDCoupling return _MEDCoupling.DataArrayInt____new___(cls,args) @@ -190,6 +193,30 @@ def ParaMEDMEMDenseMatrixIadd(self,*args): def ParaMEDMEMDenseMatrixIsub(self,*args): import _MEDCouplingRemapper return _MEDCouplingRemapper.DenseMatrix____isub___(self, self, *args) +def ParaMEDMEMMEDCouplingUMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingUMesh____new___(cls,args) +def ParaMEDMEMMEDCoupling1DGTUMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCoupling1DGTUMesh____new___(cls,args) +def ParaMEDMEMMEDCoupling1SGTUMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCoupling1SGTUMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingCurveLinearMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingCurveLinearMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingCMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingCMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingIMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingIMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingExtrudedMeshnew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingExtrudedMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args): + import _MEDCouplingRemapper + return _MEDCouplingRemapper.MEDCouplingFieldDouble____new___(cls,args) %} %include "MEDCouplingFinalize.i" diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index 546c67b9a..baa712d4f 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -21,6 +21,9 @@ %include "MEDLoaderCommon.i" %pythoncode %{ +def ParaMEDMEMDataArrayDoublenew(cls,*args): + import _MEDLoader + return _MEDLoader.DataArrayDouble____new___(cls,args) def ParaMEDMEMDataArrayDoubleIadd(self,*args): import _MEDLoader return _MEDLoader.DataArrayDouble____iadd___(self, self, *args) @@ -36,21 +39,9 @@ def ParaMEDMEMDataArrayDoubleIdiv(self,*args): def ParaMEDMEMDataArrayDoubleIpow(self,*args): import _MEDLoader return _MEDLoader.DataArrayDouble____ipow___(self, self, *args) -def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args): - import _MEDLoader - return _MEDLoader.MEDCouplingFieldDouble____iadd___(self, self, *args) -def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args): - import _MEDLoader - return _MEDLoader.MEDCouplingFieldDouble____isub___(self, self, *args) -def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args): - import _MEDLoader - return _MEDLoader.MEDCouplingFieldDouble____imul___(self, self, *args) -def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args): +def ParaMEDMEMDataArrayIntnew(cls,*args): import _MEDLoader - return _MEDLoader.MEDCouplingFieldDouble____idiv___(self, self, *args) -def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args): - import _MEDLoader - return _MEDLoader.MEDCouplingFieldDouble____ipow___(self, self, *args) + return _MEDLoader.DataArrayInt____new___(cls,args) def ParaMEDMEMDataArrayIntIadd(self,*args): import _MEDLoader return _MEDLoader.DataArrayInt____iadd___(self, self, *args) @@ -102,6 +93,30 @@ def ParaMEDMEMDenseMatrixIadd(self,*args): def ParaMEDMEMDenseMatrixIsub(self,*args): import _MEDLoader return _MEDLoader.DenseMatrix____isub___(self, self, *args) +def ParaMEDMEMMEDCouplingUMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingUMesh____new___(cls,args) +def ParaMEDMEMMEDCoupling1DGTUMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCoupling1DGTUMesh____new___(cls,args) +def ParaMEDMEMMEDCoupling1SGTUMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCoupling1SGTUMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingCurveLinearMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingCurveLinearMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingCMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingCMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingIMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingIMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingExtrudedMeshnew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingExtrudedMesh____new___(cls,args) +def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args): + import _MEDLoader + return _MEDLoader.MEDCouplingFieldDouble____new___(cls,args) %} %include "MEDCouplingFinalize.i" diff --git a/src/RENUMBER_Swig/MEDRenumber.i b/src/RENUMBER_Swig/MEDRenumber.i index 23cc5ea13..994a527c1 100644 --- a/src/RENUMBER_Swig/MEDRenumber.i +++ b/src/RENUMBER_Swig/MEDRenumber.i @@ -20,75 +20,84 @@ %include "MEDRenumberCommon.i" %pythoncode %{ +def ParaMEDMEMDataArrayDoublenew(cls,*args): + import _MEDRenumber + return _MEDRenumber.DataArrayDouble____new___(cls,args) def ParaMEDMEMDataArrayDoubleIadd(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDouble____iadd___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDouble____iadd___(self, self, *args) def ParaMEDMEMDataArrayDoubleIsub(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDouble____isub___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDouble____isub___(self, self, *args) def ParaMEDMEMDataArrayDoubleImul(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDouble____imul___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDouble____imul___(self, self, *args) def ParaMEDMEMDataArrayDoubleIdiv(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDouble____idiv___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDouble____idiv___(self, self, *args) def ParaMEDMEMDataArrayDoubleIpow(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDouble____ipow___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDouble____ipow___(self, self, *args) +def ParaMEDMEMDataArrayIntnew(cls,*args): + import _MEDRenumber + return _MEDRenumber.DataArrayInt____new___(cls,args) def ParaMEDMEMDataArrayIntIadd(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayInt____iadd___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayInt____iadd___(self, self, *args) def ParaMEDMEMDataArrayIntIsub(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayInt____isub___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayInt____isub___(self, self, *args) def ParaMEDMEMDataArrayIntImul(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayInt____imul___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayInt____imul___(self, self, *args) def ParaMEDMEMDataArrayIntIdiv(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayInt____idiv___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayInt____idiv___(self, self, *args) def ParaMEDMEMDataArrayIntImod(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayInt____imod___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayInt____imod___(self, self, *args) def ParaMEDMEMDataArrayIntIpow(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayInt____ipow___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayInt____ipow___(self, self, *args) def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDoubleTuple____iadd___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDoubleTuple____iadd___(self, self, *args) def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDoubleTuple____isub___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDoubleTuple____isub___(self, self, *args) def ParaMEDMEMDataArrayDoubleTupleImul(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDoubleTuple____imul___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDoubleTuple____imul___(self, self, *args) def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayDoubleTuple____idiv___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayDoubleTuple____idiv___(self, self, *args) def ParaMEDMEMDataArrayIntTupleIadd(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayIntTuple____iadd___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayIntTuple____iadd___(self, self, *args) def ParaMEDMEMDataArrayIntTupleIsub(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayIntTuple____isub___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayIntTuple____isub___(self, self, *args) def ParaMEDMEMDataArrayIntTupleImul(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayIntTuple____imul___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayIntTuple____imul___(self, self, *args) def ParaMEDMEMDataArrayIntTupleIdiv(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayIntTuple____idiv___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayIntTuple____idiv___(self, self, *args) def ParaMEDMEMDataArrayIntTupleImod(self,*args): - import _MEDCoupling - return _MEDCoupling.DataArrayIntTuple____imod___(self, self, *args) + import _MEDRenumber + return _MEDRenumber.DataArrayIntTuple____imod___(self, self, *args) %} + %pythoncode %{ +DataArrayDouble.__new__=classmethod(ParaMEDMEMDataArrayDoublenew) DataArrayDouble.__iadd__=ParaMEDMEMDataArrayDoubleIadd DataArrayDouble.__isub__=ParaMEDMEMDataArrayDoubleIsub DataArrayDouble.__imul__=ParaMEDMEMDataArrayDoubleImul DataArrayDouble.__idiv__=ParaMEDMEMDataArrayDoubleIdiv DataArrayDouble.__ipow__=ParaMEDMEMDataArrayDoubleIpow +DataArrayInt.__new__=classmethod(ParaMEDMEMDataArrayIntnew) DataArrayInt.__iadd__=ParaMEDMEMDataArrayIntIadd DataArrayInt.__isub__=ParaMEDMEMDataArrayIntIsub DataArrayInt.__imul__=ParaMEDMEMDataArrayIntImul @@ -107,10 +116,12 @@ DataArrayIntTuple.__imul__=ParaMEDMEMDataArrayIntTupleImul DataArrayIntTuple.__idiv__=ParaMEDMEMDataArrayIntTupleIdiv DataArrayIntTuple.__imod__=ParaMEDMEMDataArrayIntTupleImod +del ParaMEDMEMDataArrayDoublenew del ParaMEDMEMDataArrayDoubleIadd del ParaMEDMEMDataArrayDoubleIsub del ParaMEDMEMDataArrayDoubleImul del ParaMEDMEMDataArrayDoubleIdiv +del ParaMEDMEMDataArrayIntnew del ParaMEDMEMDataArrayIntIadd del ParaMEDMEMDataArrayIntIsub del ParaMEDMEMDataArrayIntImul -- 2.39.2