# Code Coupling and Code Integration documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 28 15:28:57 2009.
#
-# This file is execfile()d with the current directory set to its containing dir.
+# This file is exec(open(file).read())d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_FLAGS "-py3")
SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
SET (MEDCoupling_SWIG_DPYS_FILES
SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcoupling)
SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_FLAGS "-py3")
SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
# _ABR_ Ensure dependency mechanism on all SWIG files and headers
if(arr)
obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
else
- obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
+ obj1=PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(b));
PyTuple_SetItem(res,0,obj0);
PyTuple_SetItem(res,1,obj1);
return res;
std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
PyObject *res=PyList_New(result.size());
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
return ret;
}
const int *r=self->getAllConn(ret2);
PyObject *ret=PyTuple_New(ret2);
for(int i=0;i<ret2;i++)
- PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
+ PyTuple_SetItem(ret,i,PyLong_FromLong(r[i]));
return ret;
}
}
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
PyObject *res=PyList_New(result.size());
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
PyObject *res=PyTuple_New(2);
PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
+ PyTuple_SetItem(res,1,PyLong_FromLong(nbOfDepthPeelingPerformed));
return res;
}
double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
- PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(cellId));
return ret;
}
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
+ PyTuple_SetItem(ret,2,PyLong_FromLong(ret2));
return ret;
}
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
if(!arrIndxIn)
throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
arrIndxIn->checkAllocated();
if(arrIndxIn->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
- GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
+ GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
DataArrayInt *arrOut=0,*arrIndexOut=0;
MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
PyObject *ret=PyTuple_New(2);
std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
PyObject *res = PyList_New(result.size());
for (int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
for(std::size_t i=0;i<ret.size();i++)
{
PyObject *tmp=PyTuple_New(2);
- PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
- PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+ PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+ PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
PyList_SetItem(retPy,i,tmp);
}
return retPy;
for(std::size_t i=0;i<ret.size();i++)
{
PyObject *tmp=PyTuple_New(2);
- PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
- PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+ PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+ PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
PyList_SetItem(retPy,i,tmp);
}
return retPy;
for(std::size_t i=0;i<partCompactFormat.size();i++)
{
PyObject *tmp4=PyTuple_New(2);
- PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
- PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
+ PyTuple_SetItem(tmp4,0,PyLong_FromLong(partCompactFormat[i].first));
+ PyTuple_SetItem(tmp4,1,PyLong_FromLong(partCompactFormat[i].second));
PyList_SetItem(ret1Py,i,tmp4);
}
PyTuple_SetItem(ret,1,ret1Py);
for(std::size_t i=0;i<ret.size();i++)
{
PyObject *tmp(PyTuple_New(2));
- PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
- PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+ PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+ PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
PyList_SetItem(retPy,i,tmp);
}
return retPy;
for(std::size_t i=0;i<ret.size();i++)
{
PyObject *tmp(PyTuple_New(2));
- PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
- PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+ PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+ PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
PyList_SetItem(retPy,i,tmp);
}
return retPy;
for(std::size_t i=0;i<ret.size();i++)
{
PyObject *tmp(PyTuple_New(2));
- PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
- PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+ PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+ PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
PyList_SetItem(retPy,i,tmp);
}
return retPy;
PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
else
{
- PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
+ PyObject *res1=PySlice_New(PyLong_FromLong(bb),PyLong_FromLong(ee),PyLong_FromLong(ss));
PyTuple_SetItem(res,1,res1);
}
return res;
{// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
////
- PyObject *a(PyInt_FromLong(0));
+ PyObject *a(PyLong_FromLong(0));
PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
Py_DECREF(a);
if(!uniqueElt)
PyObject *ret(PyTuple_New(1));
PyObject *ret0(PyDict_New());
{
- PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
+ PyObject *a(PyLong_FromLong(0)),*b(PyLong_FromLong(self->getTypeOfField())),*c(PyLong_FromLong(self->getTimeDiscretization()));
PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
PyDict_SetItem(ret0,a,d);
Py_DECREF(a); Py_DECREF(d);
int meshId,arrId,arrIdInField,fieldId;
self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
PyObject *res=PyList_New(4);
- PyList_SetItem(res,0,PyInt_FromLong(meshId));
- PyList_SetItem(res,1,PyInt_FromLong(arrId));
- PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
- PyList_SetItem(res,3,PyInt_FromLong(fieldId));
+ PyList_SetItem(res,0,PyLong_FromLong(meshId));
+ PyList_SetItem(res,1,PyLong_FromLong(arrId));
+ PyList_SetItem(res,2,PyLong_FromLong(arrIdInField));
+ PyList_SetItem(res,3,PyLong_FromLong(fieldId));
return res;
}
int meshId,arrId,arrIdInField,fieldId;
self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
PyObject *res=PyList_New(4);
- PyList_SetItem(res,0,PyInt_FromLong(meshId));
- PyList_SetItem(res,1,PyInt_FromLong(arrId));
- PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
- PyList_SetItem(res,3,PyInt_FromLong(fieldId));
+ PyList_SetItem(res,0,PyLong_FromLong(meshId));
+ PyList_SetItem(res,1,PyLong_FromLong(arrId));
+ PyList_SetItem(res,2,PyLong_FromLong(arrIdInField));
+ PyList_SetItem(res,3,PyLong_FromLong(fieldId));
return res;
}
}
import os
__filename=os.environ.get('PYTHONSTARTUP')
if __filename and os.path.isfile(__filename):
- execfile(__filename)
+ exec(open(__filename).read())
pass
%}
* This method is an extention of PySlice_GetIndices but less
* open than PySlice_GetIndicesEx that accepts too many situations.
*/
-void GetIndicesOfSlice(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
+void GetIndicesOfSlice(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
{
int ret(PySlice_GetIndices(slice,length,start,stop,step));
if(ret==0)
/*!
* This method allows to retrieve slice info from \a slice.
*/
-void GetIndicesOfSliceExplicitely(PySliceObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
+void GetIndicesOfSliceExplicitely(PyObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
{
int ret(PySlice_GetIndices(slice,std::numeric_limits<int>::max(),start,stop,step));
if(ret==0)
//
PyObject *args(PyTuple_New(1)),*args0(PyTuple_New(3)),*kw(PyDict_New()),*kw1(PyTuple_New(2));
PyTuple_SetItem(args0,0,a); PyTuple_SetItem(args0,1,b); PyTuple_SetItem(args0,2,c); PyTuple_SetItem(args,0,args0);
- PyTuple_SetItem(kw1,0,PyInt_FromLong(nbRows)); PyTuple_SetItem(kw1,1,PyInt_FromLong(nbCols));
+ PyTuple_SetItem(kw1,0,PyLong_FromLong(nbRows)); PyTuple_SetItem(kw1,1,PyLong_FromLong(nbCols));
PyObject *tmp1(PyString_FromString("shape"));
PyDict_SetItem(kw,tmp1,kw1); Py_DECREF(tmp1); Py_DECREF(kw1);
PyObject* pdict=PyDict_New();
{
PyObject *ret=PyList_New(size);
for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong(ptr[i]));
+ PyList_SetItem(ret,i,PyLong_FromLong(ptr[i]));
return ret;
}
int size=v.size();
PyObject *ret=PyList_New(size);
for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong(v[i]));
+ PyList_SetItem(ret,i,PyLong_FromLong(v[i]));
return ret;
}
PyObject *ret=PyList_New(size);
std::set<int>::const_iterator it=v.begin();
for(int i=0;i<size;i++,it++)
- PyList_SetItem(ret,i,PyInt_FromLong(*it));
+ PyList_SetItem(ret,i,PyLong_FromLong(*it));
return ret;
}
{
PyObject *t=PyTuple_New(nbOfComp);
for(int j=0;j<nbOfComp;j++)
- PyTuple_SetItem(t,j,PyInt_FromLong(vals[i*nbOfComp+j]));
+ PyTuple_SetItem(t,j,PyLong_FromLong(vals[i*nbOfComp+j]));
PyList_SetItem(ret,i,t);
}
return ret;
for(int i=0;i<*size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
- if(PyInt_Check(o))
+ if(PyLong_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ int val=(int)PyLong_AS_LONG(o);
tmp[i]=val;
}
else
for(int i=0;i<*size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
- if(PyInt_Check(o))
+ if(PyLong_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ int val=(int)PyLong_AS_LONG(o);
tmp[i]=val;
}
else
for(std::size_t i=0;i<arr.size();i++)
{
PyObject *t=PyTuple_New(2);
- PyTuple_SetItem(t,0,PyInt_FromLong(arr[i].first));
- PyTuple_SetItem(t,1,PyInt_FromLong(arr[i].second));
+ PyTuple_SetItem(t,0,PyLong_FromLong(arr[i].first));
+ PyTuple_SetItem(t,1,PyLong_FromLong(arr[i].second));
PyList_SetItem(ret,i,t);
}
return ret;
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *o_0=PyTuple_GetItem(o,0);
- if(!PyInt_Check(o_0))
+ if(!PyLong_Check(o_0))
throw INTERP_KERNEL::Exception(msg);
PyObject *o_1=PyTuple_GetItem(o,1);
- if(!PyInt_Check(o_1))
+ if(!PyLong_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
- arr[i].first=(int)PyInt_AS_LONG(o_0);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].first=(int)PyLong_AS_LONG(o_0);
+ arr[i].second=(int)PyLong_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
if(sz2!=2)
throw INTERP_KERNEL::Exception(msg);
PyObject *o_0=PyTuple_GetItem(o,0);
- if(!PyInt_Check(o_0))
+ if(!PyLong_Check(o_0))
throw INTERP_KERNEL::Exception(msg);
PyObject *o_1=PyTuple_GetItem(o,1);
- if(!PyInt_Check(o_1))
+ if(!PyLong_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
- arr[i].first=(int)PyInt_AS_LONG(o_0);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].first=(int)PyLong_AS_LONG(o_0);
+ arr[i].second=(int)PyLong_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
if(!PyString_Check(o_0))
throw INTERP_KERNEL::Exception(msg);
PyObject *o_1=PyTuple_GetItem(o,1);
- if(!PyInt_Check(o_1))
+ if(!PyLong_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
arr[i].first=PyString_AsString(o_0);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].second=(int)PyLong_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
if(!PyString_Check(o_0))
throw INTERP_KERNEL::Exception(msg);
PyObject *o_1=PyTuple_GetItem(o,1);
- if(!PyInt_Check(o_1))
+ if(!PyLong_Check(o_1))
throw INTERP_KERNEL::Exception(msg);
arr[i].first=PyString_AsString(o_0);
- arr[i].second=(int)PyInt_AS_LONG(o_1);
+ arr[i].second=(int)PyLong_AS_LONG(o_1);
}
else
throw INTERP_KERNEL::Exception(msg);
for(int i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
- if(PyInt_Check(o))
+ if(PyLong_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ int val=(int)PyLong_AS_LONG(o);
arr[i]=val;
}
else
for(int i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
- if(PyInt_Check(o))
+ if(PyLong_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ int val=(int)PyLong_AS_LONG(o);
arr[i]=val;
}
else
for(int i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
- if(PyInt_Check(o))
+ if(PyLong_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ int val=(int)PyLong_AS_LONG(o);
arr.push_back(val);
}
else
for(int i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
- if(PyInt_Check(o))
+ if(PyLong_Check(o))
{
- int val=(int)PyInt_AS_LONG(o);
+ int val=(int)PyLong_AS_LONG(o);
arr.push_back(val);
}
else
static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<int>& ret)
{
static const char MSG[]="fillArrayWithPyListInt3 : It appears that the input list or tuple is composed by elts having different sizes !";
- if(PyInt_Check(pyLi))
+ if(PyLong_Check(pyLi))
{
- long val=PyInt_AS_LONG(pyLi);
+ long val=PyLong_AS_LONG(pyLi);
if(nbOfElt==-1)
nbOfElt=1;
else
for(int i=0;i<sz;i++)
{
PyObject *o=PyList_GetItem(pyLi,i);
- if(PyInt_Check(o))
- vec[i]=PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ vec[i]=PyLong_AS_LONG(o);
else
return false;
}
for(int i=0;i<sz;i++)
{
PyObject *o=PyTuple_GetItem(pyLi,i);
- if(PyInt_Check(o))
- vec[i]=PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ vec[i]=PyLong_AS_LONG(o);
else
return false;
}
double val=PyFloat_AS_DOUBLE(o);
tmp[i]=val;
}
- else if(PyInt_Check(o))
+ else if(PyLong_Check(o))
{
- long val0=PyInt_AS_LONG(o);
+ long val0=PyLong_AS_LONG(o);
double val=val0;
tmp[i]=val;
}
double val=PyFloat_AS_DOUBLE(o);
tmp[i]=val;
}
- else if(PyInt_Check(o))
+ else if(PyLong_Check(o))
{
- long val0=PyInt_AS_LONG(o);
+ long val0=PyLong_AS_LONG(o);
double val=val0;
tmp[i]=val;
}
double val=PyFloat_AS_DOUBLE(pyLi);
ret.push_back(val);
}
- else if(PyInt_Check(pyLi))
+ else if(PyLong_Check(pyLi))
{
- long val0=PyInt_AS_LONG(pyLi);
+ long val0=PyLong_AS_LONG(pyLi);
double val=val0;
if(nbOfElt==-1)
nbOfElt=1;
static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, MEDCoupling::DataArrayInt *& daIntTyypp, MEDCoupling::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception)
{
sw=-1;
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(int)PyLong_AS_LONG(value);
sw=1;
return;
}
for(int i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
for(int i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
sw=1;
return;
}
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- iTyypp=(double)PyInt_AS_LONG(value);
+ iTyypp=(double)PyLong_AS_LONG(value);
sw=1;
return;
}
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
sw=1;
return;
}
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- iTyypp=(double)PyInt_AS_LONG(value);
+ iTyypp=(double)PyLong_AS_LONG(value);
sw=1;
return;
}
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
{
const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple";
sw=-1;
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(int)PyLong_AS_LONG(value);
sw=1;
return;
}
for(int i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
for(int i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
if(PySlice_Check(value))
{
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *oC=reinterpret_cast<PySliceObject *>(value);
- GetIndicesOfSlice(oC,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
+ GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
p.first=strt;
p.second.first=stp;
p.second.second=step;
static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
{
sw=-1;
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(int)PyLong_AS_LONG(value);
sw=1;
return;
}
for(int i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
for(int i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
if(PySlice_Check(value))
{
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *oC=reinterpret_cast<PySliceObject *>(value);
- GetIndicesOfSlice(oC,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
+ GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
p.first=strt;
p.second.first=stp;
p.second.second=step;
sw=1;
return;
}
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- val=(double)PyInt_AS_LONG(value);
+ val=(double)PyLong_AS_LONG(value);
sw=1;
return;
}
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
f[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- f[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ f[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
f[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- f[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ f[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
}
return &val;
}
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- val=(double)PyInt_AS_LONG(value);
+ val=(double)PyLong_AS_LONG(value);
sw=1;
if(nbTuplesExpected*nbCompExpected!=1)
{
- std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyInt) !";
+ std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyLong) !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return &val;
nbTuples=1;
return &val;
}
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- val=(double)PyInt_AS_LONG(value);
+ val=(double)PyLong_AS_LONG(value);
sw=1;
if(nbCompExpected!=1)
{
- std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyInt) !";
+ std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyLong) !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
nbTuples=1;
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
f[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- f[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ f[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
f[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- f[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ f[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
nbTuples=1;
return &val;
}
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- val=(double)PyInt_AS_LONG(value);
+ val=(double)PyLong_AS_LONG(value);
sw=1;
nbTuples=1;
return &val;
PyObject *o=PyTuple_GetItem(value,i);
if(PyFloat_Check(o))
f[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- f[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ f[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
PyObject *o=PyList_GetItem(value,i);
if(PyFloat_Check(o))
f[i]=PyFloat_AS_DOUBLE(o);
- else if(PyInt_Check(o))
- f[i]=(double)PyInt_AS_LONG(o);
+ else if(PyLong_Check(o))
+ f[i]=(double)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
static const int *convertObjToPossibleCpp1_Safe(PyObject *value, int& sw, int& sz, int& iTyypp, std::vector<int>& stdvecTyypp) throw(INTERP_KERNEL::Exception)
{
sw=-1;
- if(PyInt_Check(value))
+ if(PyLong_Check(value))
{
- iTyypp=(int)PyInt_AS_LONG(value);
+ iTyypp=(int)PyLong_AS_LONG(value);
sw=1; sz=1;
return &iTyypp;
}
for(int i=0;i<size;i++)
{
PyObject *o=PyTuple_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
for(int i=0;i<size;i++)
{
PyObject *o=PyList_GetItem(value,i);
- if(PyInt_Check(o))
- stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+ if(PyLong_Check(o))
+ stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
else
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
PyObject *zeNumpyRepr(0);
{
- PyObject *tmp1(PyInt_FromLong(0));
+ PyObject *tmp1(PyLong_FromLong(0));
zeNumpyRepr=PyDict_GetItem(PyTuple_GetItem(args,1),tmp1);//borrowed
Py_DECREF(tmp1);
}
PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
else
{
- PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
+ PyObject *res1=PySlice_New(PyLong_FromLong(bb),PyLong_FromLong(ee),PyLong_FromLong(ss));
PyTuple_SetItem(res,1,res1);
}
return res;
for(std::size_t i=0;i<sz;i++)
{
PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
+ PyList_SetItem(pyRet1,i,PyLong_FromLong(ret1[i]));
}
PyTuple_SetItem(pyRet,0,pyRet0);
PyTuple_SetItem(pyRet,1,pyRet1);
DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
return ret;
}
DataArrayDouble *ret0=self->computeInverseMatrix(mesh,ret1,ret2);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
- PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
+ PyTuple_SetItem(ret,2,PyLong_FromLong(ret2));
return ret;
}
DataArrayDouble *ret0=self->computeMatrix(mesh,ret1,ret2);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
- PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
+ PyTuple_SetItem(ret,2,PyLong_FromLong(ret2));
return ret;
}
DataArrayDouble *ret0=self->computeEvaluationMatrixOnGivenPts(mesh,inp,nbPts,ret1);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
return ret;
}
DataArrayDouble *ret0(self->performDrift(matr,arr,ret1));
PyObject *res(PyTuple_New(2));
PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
- PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
+ PyTuple_SetItem(res,1,PyLong_FromLong(ret1));
return res;
}
DataArrayDouble *ret0(MEDCouplingFieldDiscretizationKriging::PerformDriftRect(matr,arr,ret1));
PyObject *res(PyTuple_New(2));
PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
- PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
+ PyTuple_SetItem(res,1,PyLong_FromLong(ret1));
return res;
}
{
int a,b,c;
self->getSlice(a,b,c);
- return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
+ return PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(c));
}
std::string __str__() const throw(INTERP_KERNEL::Exception)
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
+ GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
int a,b;
DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
- return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
+ return PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(step));
}
PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
+ GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
int a,b;
DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
- return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
+ return PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(step));
}
static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
+ GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
}
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
+ GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
}
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
+ GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
}
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
+ GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
}
{
if(nbOfTuples)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
if(elt2)
{
- if(PyInt_Check(elt2))
+ if(PyLong_Check(elt2))
{//DataArrayDouble.New([1.,3.,4.,5.],2,2)
- int nbOfCompo=PyInt_AS_LONG(elt2);
+ int nbOfCompo=PyLong_AS_LONG(elt2);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
return ret.retn();
}
}
- else if(PyInt_Check(elt0))
+ else if(PyLong_Check(elt0))
{
- int nbOfTuples1=PyInt_AS_LONG(elt0);
+ int nbOfTuples1=PyLong_AS_LONG(elt0);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(!elt2)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{//DataArrayDouble.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
{
if(nbOfTuples)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
if(nbOfComp)
{
- if(PyInt_Check(nbOfComp))
+ if(PyLong_Check(nbOfComp))
{//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ int nbOfCompo=PyLong_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
- PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
- PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(thisTupleId));
+ PyTuple_SetItem(ret,2,PyLong_FromLong(otherTupleId));
return ret;
}
double r1=self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
double r1=self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tupleId));
return ret;
}
PyObject *ret0(PyDict_New());
PyObject *numpyArryObj(MEDCoupling_DataArrayDouble_toNumPyArray(self));
{// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
- PyObject *tmp1(PyInt_FromLong(0));
+ PyObject *tmp1(PyLong_FromLong(0));
PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
PyTuple_SetItem(ret,0,ret0);
}
PyObject *__len__() throw(INTERP_KERNEL::Exception)
{
- return PyInt_FromLong(self->getNumberOfCompo());
+ return PyLong_FromLong(self->getNumberOfCompo());
}
PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
if(nbOfTuples)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
if(nbOfComp)
{
- if(PyInt_Check(nbOfComp))
+ if(PyLong_Check(nbOfComp))
{//DataArrayInt.New([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ int nbOfCompo=PyLong_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
MCAuto<DataArrayInt> ret=DataArrayInt::New();
return ret.retn();
}
}
- else if(PyInt_Check(elt0))
+ else if(PyLong_Check(elt0))
{
- int nbOfTuples1=PyInt_AS_LONG(elt0);
+ int nbOfTuples1=PyLong_AS_LONG(elt0);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(!nbOfComp)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{//DataArrayInt.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
MCAuto<DataArrayInt> ret=DataArrayInt::New();
std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
PyObject *ret=PyList_New(slcs.size());
for(std::size_t i=0;i<slcs.size();i++)
- PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
+ PyList_SetItem(ret,i,PySlice_New(PyLong_FromLong(slcs[i].first),PyLong_FromLong(slcs[i].second),PyLong_FromLong(1)));
return ret;
}
if(!PySlice_Check(slic))
throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
- GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
+ GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
int a,b;
self->getMinMaxValues(a,b);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(a));
- PyTuple_SetItem(ret,1,PyInt_FromLong(b));
+ PyTuple_SetItem(ret,0,PyLong_FromLong(a));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(b));
return ret;
}
DataArrayInt *ret0=MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
- PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(newNbOfTuples));
return ret;
}
{
if(nbOfTuples && nbOfTuples != Py_None)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
if(nbOfTuples<0)
throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
if(nbOfComp && nbOfComp != Py_None)
{
- if(PyInt_Check(nbOfComp))
+ if(PyLong_Check(nbOfComp))
{//DataArrayInt.setValues([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ int nbOfCompo=PyLong_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
int tmp;
int r1=self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
int tmp;
int r1=self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
{
case 1:
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- int val=(int)PyInt_AS_LONG(obj);
+ int val=(int)PyLong_AS_LONG(obj);
return self->findIdFirstEqual(val);
}
else
return false;
case 1:
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- int val=(int)PyInt_AS_LONG(obj);
+ int val=(int)PyLong_AS_LONG(obj);
return self->presenceOfValue(val);
}
else
case 1:
{
if(nbOfComponents==1)
- return PyInt_FromLong(self->getIJSafe(it1,0));
+ return PyLong_FromLong(self->getIJSafe(it1,0));
return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 2:
case 4:
return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 5:
- return PyInt_FromLong(self->getIJSafe(it1,ic1));
+ return PyLong_FromLong(self->getIJSafe(it1,ic1));
case 6:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
for(std::size_t i=0;i<sz;i++)
{
PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
+ PyList_SetItem(pyRet1,i,PyLong_FromLong(ret1[i]));
}
PyTuple_SetItem(pyRet,0,pyRet0);
PyTuple_SetItem(pyRet,1,pyRet1);
Py_XINCREF(ret0Py);
PyTuple_SetItem(pyRet,0,ret0Py);
if(ret)
- ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
+ ret1Py=PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(c));
else
{
ret1Py=Py_None;
PyObject *ret0(PyDict_New());
PyObject *numpyArryObj(MEDCoupling_DataArrayInt_toNumPyArray(self));
{// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
- PyObject *tmp1(PyInt_FromLong(0));
+ PyObject *tmp1(PyLong_FromLong(0));
PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
PyTuple_SetItem(ret,0,ret0);
}
PyObject *__len__() throw(INTERP_KERNEL::Exception)
{
- return PyInt_FromLong(self->getNumberOfCompo());
+ return PyLong_FromLong(self->getNumberOfCompo());
}
PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
return 0;
}
if(singleVal>=0)
- return PyInt_FromLong(pt[singleVal]);
+ return PyLong_FromLong(pt[singleVal]);
else
{
if(nbc+singleVal>0)
- return PyInt_FromLong(pt[nbc+singleVal]);
+ return PyLong_FromLong(pt[nbc+singleVal]);
else
{
std::ostringstream oss;
oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
+ PyTuple_SetItem(t,j,PyLong_FromLong(pt[cid]));
}
return t;
}
int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
PyObject *t=PyTuple_New(sz);
for(int j=0;j<sz;j++)
- PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
+ PyTuple_SetItem(t,j,PyLong_FromLong(pt[slic.first+j*slic.second.second]));
return t;
}
default:
{
if(nbOfTuples)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
if(nbOfComp)
{
- if(PyInt_Check(nbOfComp))
+ if(PyLong_Check(nbOfComp))
{//DataArrayByte.New([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ int nbOfCompo=PyLong_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
MCAuto<DataArrayByte> ret=DataArrayByte::New();
return ret.retn();
}
}
- else if(PyInt_Check(elt0))
+ else if(PyLong_Check(elt0))
{
- int nbOfTuples1=PyInt_AS_LONG(elt0);
+ int nbOfTuples1=PyLong_AS_LONG(elt0);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(!nbOfComp)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{//DataArrayByte.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
MCAuto<DataArrayByte> ret=DataArrayByte::New();
INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
self->getTuple(tupleId,tmp);
PyObject *ret=PyTuple_New(sz);
- for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
+ for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyLong_FromLong((int)tmp[i]));
return ret;
}
int tmp;
int r1=(int)self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
int tmp;
int r1=(int)self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
{
case 1:
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- int val=(int)PyInt_AS_LONG(obj);
+ int val=(int)PyLong_AS_LONG(obj);
return self->findIdFirstEqual(val);
}
else
return false;
case 1:
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- int val=(int)PyInt_AS_LONG(obj);
+ int val=(int)PyLong_AS_LONG(obj);
return self->presenceOfValue(val);
}
else
PyObject *ret0(PyDict_New());
PyObject *numpyArryObj(MEDCoupling_DataArrayByte_toNumPyArray(self));
{// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
- PyObject *tmp1(PyInt_FromLong(0));
+ PyObject *tmp1(PyLong_FromLong(0));
PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
PyTuple_SetItem(ret,0,ret0);
}
{
if(nbOfTuples)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{
- int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+ int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
if(nbOfComp)
{
- if(PyInt_Check(nbOfComp))
+ if(PyLong_Check(nbOfComp))
{//DataArrayAsciiChar.New([1,3,4,5],2,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+ int nbOfCompo=PyLong_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
}
}
}
- else if(PyInt_Check(elt0))
+ else if(PyLong_Check(elt0))
{
- int nbOfTuples1=PyInt_AS_LONG(elt0);
+ int nbOfTuples1=PyLong_AS_LONG(elt0);
if(nbOfTuples1<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
if(nbOfTuples)
{
if(!nbOfComp)
{
- if(PyInt_Check(nbOfTuples))
+ if(PyLong_Check(nbOfTuples))
{//DataArrayAsciiChar.New(5,2)
- int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+ int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
tmp2[0]=self->getMaxValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
tmp2[0]=self->getMinValue(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
- PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+ PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
return ret;
}
const std::map<int,double>& row=m[i];
PyObject *ret0=PyDict_New();
for(std::map<int,double>::const_iterator it=row.begin();it!=row.end();it++)
- PyDict_SetItem(ret0,PyInt_FromLong((*it).first),PyFloat_FromDouble((*it).second));
+ PyDict_SetItem(ret0,PyLong_FromLong((*it).first),PyFloat_FromDouble((*it).second));
PyList_SetItem(ret,i,ret0);
}
return ret;
ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_FLAGS "-py3")
SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
SET (MEDLoader_SWIG_DPYS_FILES
int size=v.size();
PyObject *ret=PyList_New(size);
for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
+ PyList_SetItem(ret,i,PyLong_FromLong((int)v[i]));
return ret;
}
DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
{// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
- PyObject *tmp1(PyInt_FromLong(0));
+ PyObject *tmp1(PyLong_FromLong(0));
PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
PyTuple_SetItem(ret,0,ret0);
}
MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
+ MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfJoints()));
if(ret)
ret->incrRef();
return ret;
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
PyObject *res=PyList_New(result.size());
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
}
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
PyObject *res=PyList_New(result.size());
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
PyObject *res=PyList_New(result.size());
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
+ MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfMeshes()));
if(ret)
ret->incrRef();
return ret;
int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
{
- if(elt0 && PyInt_Check(elt0))
+ if(elt0 && PyLong_Check(elt0))
{//fmts[3]
- int pos=PyInt_AS_LONG(elt0);
+ int pos=PyLong_AS_LONG(elt0);
return pos;
}
else if(elt0 && PyTuple_Check(elt0))
{
PyObject *o0=PyTuple_GetItem(elt0,0);
PyObject *o1=PyTuple_GetItem(elt0,1);
- if(PyInt_Check(o0) && PyInt_Check(o1))
+ if(PyLong_Check(o0) && PyLong_Check(o1))
{//fmts(1,-1)
- int iter=PyInt_AS_LONG(o0);
- int order=PyInt_AS_LONG(o1);
+ int iter=PyLong_AS_LONG(o0);
+ int order=PyLong_AS_LONG(o1);
return self->getPosOfTimeStep(iter,order);
}
else
if(PySlice_Check(elts))
{
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
- GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
+ GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
self->eraseTimeStepIds2(strt,stp,step);
}
else
else if(elt0 && PySlice_Check(elt0))
{
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
- GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
+ GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
}
else
int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
{
- if(elt0 && PyInt_Check(elt0))
+ if(elt0 && PyLong_Check(elt0))
{//fmts[3]
- return PyInt_AS_LONG(elt0);
+ return PyLong_AS_LONG(elt0);
}
else if(elt0 && PyString_Check(elt0))
return self->getPosFromFieldName(PyString_AsString(elt0));
if(elts && PySlice_Check(elts))
{
Py_ssize_t strt=2,stp=2,step=2;
- PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
- GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
+ GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
self->destroyFieldsAtPos2(strt,stp,step);
}
else
int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
{
- if(elt0 && PyInt_Check(elt0))
+ if(elt0 && PyLong_Check(elt0))
{//fmts[3]
- int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
+ int pos=InterpreteNegativeInt(PyLong_AS_LONG(elt0),self->getNumberOfTS());
return pos;
}
else if(elt0 && PyTuple_Check(elt0))
{
PyObject *o0=PyTuple_GetItem(elt0,0);
PyObject *o1=PyTuple_GetItem(elt0,1);
- if(PyInt_Check(o0) && PyInt_Check(o1))
+ if(PyLong_Check(o0) && PyLong_Check(o1))
{//fmts(1,-1)
- int iter=PyInt_AS_LONG(o0);
- int order=PyInt_AS_LONG(o1);
+ int iter=PyLong_AS_LONG(o0);
+ int order=PyLong_AS_LONG(o1);
return self->getPosOfTimeStep(iter,order);
}
else
MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
+ MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfParams()));
if(ret)
ret->incrRef();
return ret;
std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
PyObject *res(PyList_New(result.size()));
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
}
std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
PyObject *res(PyList_New(result.size()));
for(int i=0;iL!=result.end(); i++, iL++)
- PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ PyList_SetItem(res,i,PyLong_FromLong(*iL));
return res;
}
}
if(size2!=2)
throw INTERP_KERNEL::Exception("tuples in list must be of size 2 (dt,it) !");
PyObject *o0=PyTuple_GetItem(o,0);
- if(PyInt_Check(o0))
- p.first=(int)PyInt_AS_LONG(o0);
+ if(PyLong_Check(o0))
+ p.first=(int)PyLong_AS_LONG(o0);
else
throw INTERP_KERNEL::Exception("First elem of tuples in list must be integer : dt !");
PyObject *o1=PyTuple_GetItem(o,1);
- if(PyInt_Check(o1))
- p.second=(int)PyInt_AS_LONG(o1);
+ if(PyLong_Check(o1))
+ p.second=(int)PyLong_AS_LONG(o1);
else
throw INTERP_KERNEL::Exception("Second elem of tuples in list must be integer : dt !");
ret[i]=p;
*/
int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS *self, PyObject *elt0) throw(INTERP_KERNEL::Exception)
{
- if(elt0 && PyInt_Check(elt0))
+ if(elt0 && PyLong_Check(elt0))
{//fmts[3]
- return InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
+ return InterpreteNegativeInt(PyLong_AS_LONG(elt0),self->getNumberOfTS());
}
else if(elt0 && PyTuple_Check(elt0))
{
{
PyObject *o0=PyTuple_GetItem(elt0,0);
PyObject *o1=PyTuple_GetItem(elt0,1);
- if(PyInt_Check(o0) && PyInt_Check(o1))
+ if(PyLong_Check(o0) && PyLong_Check(o1))
{//fmts(1,-1)
- int iter=PyInt_AS_LONG(o0);
- int order=PyInt_AS_LONG(o1);
+ int iter=PyLong_AS_LONG(o0);
+ int order=PyLong_AS_LONG(o1);
return self->getPosOfTimeStep(iter,order);
}
else
*/
int MEDFileFieldsgetitemSingleTS__(const MEDFileFields *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- if(PyInt_Check(obj))
+ if(PyLong_Check(obj))
{
- return InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfFields());
+ return InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfFields());
}
else if(PyString_Check(obj))
{
cppMap.clear();
while (PyDict_Next(pyMap,&pos,&key,&value))
{
- if(!PyInt_Check(key))
- throw INTERP_KERNEL::Exception("convertToMapIntDataArrayInt : keys in map must be PyInt !");
- long k(PyInt_AS_LONG(key));
+ if(!PyLong_Check(key))
+ throw INTERP_KERNEL::Exception("convertToMapIntDataArrayInt : keys in map must be PyLong !");
+ long k(PyLong_AS_LONG(key));
void *argp(0);
int status(SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
if(!SWIG_IsOK(status))
ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES SWIG_FLAGS "-py3")
SET(SWIG_MODULE_MEDPartitioner_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
SET (MEDPartitioner_SWIG_DPYS_FILES
INCLUDE(${SWIG_USE_FILE})
SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_FLAGS "-py3")
SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
SET (ParaMEDMEM_SWIG_DPYS_FILES
SWIG_LINK_LIBRARIES(ParaMEDMEM ${PYTHON_LIBRARIES} paramedmem medloader)
SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_FLAGS "-py3")
INSTALL(TARGETS _ParaMEDMEM DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
INSTALL(FILES ParaMEDMEM.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
int size=self->getCellMesh()->getNumberOfCells();
PyObject *ret=PyList_New(size);
for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
+ PyList_SetItem(ret,i,PyLong_FromLong(tmp[i]));
return ret;
}
int size=self->getFaceMesh()->getNumberOfCells();
PyObject *ret=PyList_New(size);
for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
+ PyList_SetItem(ret,i,PyLong_FromLong(tmp[i]));
return ret;
}
int size=self->getCellMesh()->getNumberOfNodes();
PyObject *ret=PyList_New(size);
for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong(tmp[i]));
+ PyList_SetItem(ret,i,PyLong_FromLong(tmp[i]));
return ret;
}
}
// Map mpi_comm_world and mpi_comm_self -> MPI_COMM_WORLD and MPI_COMM_SELF
%typemap(in) MPI_Comm
{
- switch (PyInt_AsLong($input))
+ switch (PyLong_AsLong($input))
{
case mpi_comm_world: $1 = MPI_COMM_WORLD; break;
case mpi_comm_self: $1 = MPI_COMM_SELF; break;
// Map mpi_double and mpi_int -> MPI_DOUBLE and MPI_INT
%typemap(in) MPI_Datatype
{
- switch (PyInt_AsLong($input))
+ switch (PyLong_AsLong($input))
{
case mpi_double: $1 = MPI_DOUBLE; break;
case mpi_int: $1 = MPI_INT; break;
PyErr_SetString(PyExc_RuntimeError,"Erorr in MPI_Comm_size()");
return NULL;
}
- return PyInt_FromLong( res );
+ return PyLong_FromLong( res );
} %}
// ==============
PyErr_SetString(PyExc_RuntimeError,"Erorr in MPI_Comm_rank()");
return NULL;
}
- return PyInt_FromLong( res );
+ return PyLong_FromLong( res );
}
%}
{
aBuf = (void*) ( intBuf = new int[ nb ] );
for ( int i = 0; i < aSize; ++i )
- intBuf[i] = int( PyInt_AS_LONG( PyList_GetItem( buffer, i )));
+ intBuf[i] = int( PyLong_AS_LONG( PyList_GetItem( buffer, i )));
}
else
{
else
{
for ( int i = 0; i < aSize && !pyerr; ++i )
- pyerr = PyList_SetItem(buffer, i, PyInt_FromLong( intBuf[i] ));
+ pyerr = PyList_SetItem(buffer, i, PyLong_FromLong( intBuf[i] ));
delete [] intBuf;
}
if ( pyerr )
PyErr_SetString(PyExc_RuntimeError, "Error of PyList_SetItem()");
return NULL;
}
- return PyInt_FromLong( err );
+ return PyLong_FromLong( err );
}
%}
for (int i=0; i < size; i++)
{
PyObject * tmp = PyList_GetItem($input,i);
- TYPE elem = PyInt_AsLong(tmp);
+ TYPE elem = PyLong_AsLong(tmp);
tmpSet.insert(elem);
}
$1 = tmpSet;
ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_FLAGS "-py3")
SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
IF(Boost_FOUND)
import os
__filename=os.environ.get('PYTHONSTARTUP')
if __filename and os.path.isfile(__filename):
- execfile(__filename)
+ exec(open(__filename).read())
pass
%}