Changeset 19895
- Timestamp:
- 12/16/15 05:39:20 (9 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 210 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp ¶
r19752 r19895 23 23 IssmDouble value = 0.; 24 24 char *svalue = NULL; 25 25 26 26 27 /*Boot module: */ … … 162 163 WriteData(VALUE,value); 163 164 165 164 166 /*Clean up*/ 165 167 xDelete<char>(name); … … 168 170 /*end module: */ 169 171 MODULEEND(); 172 170 173 } -
TabularUnified issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.h ¶
r19753 r19895 5 5 #ifndef _ISSMCONFIG_H 6 6 #define _ISSMCONFIG_H 7 7 8 8 9 #ifdef HAVE_CONFIG_H -
TabularUnified issm/trunk-jpl/src/wrappers/python/include/pythonincludes.h ¶
r13750 r19895 11 11 #ifdef _HAVE_PYTHON_ 12 12 13 #if _PYTHON_MAJOR_ == 213 #if _PYTHON_MAJOR_ >= 2 14 14 #undef NPY_NO_DEPRECATED_API 15 15 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION -
TabularUnified issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp ¶
r19893 r19895 24 24 if (PyFloat_Check(py_float)) 25 25 dscalar=PyFloat_AsDouble(py_float); 26 else if (Py Int_Check(py_float))27 dscalar=(double)Py Int_AsLong(py_float);26 else if (PyLong_Check(py_float)) 27 dscalar=(double)PyLong_AsLong(py_float); 28 28 else if (PyLong_Check(py_float)) 29 29 dscalar=PyLong_AsDouble(py_float); … … 47 47 48 48 /*return internal value: */ 49 if (Py Int_Check(py_long))50 iscalar=(int)Py Int_AsLong(py_long);49 if (PyLong_Check(py_long)) 50 iscalar=(int)PyLong_AsLong(py_long); 51 51 else if (PyLong_Check(py_long)) 52 52 iscalar=(int)PyLong_AsLong(py_long); … … 74 74 if (PyBool_Check(py_boolean)) 75 75 bscalar=(bool)PyLong_AsLong(py_boolean); 76 else if (Py Int_Check(py_boolean))77 bscalar=(bool)Py Int_AsLong(py_boolean);76 else if (PyLong_Check(py_boolean)) 77 bscalar=(bool)PyLong_AsLong(py_boolean); 78 78 else if (PyLong_Check(py_boolean)) 79 79 bscalar=(bool)PyLong_AsLong(py_boolean); … … 724 724 /*Fetch all options*/ 725 725 for (int i=istart; i<nrhs; i=i+2){ 726 if (!Py String_Check(PyTuple_GetItem(py_tuple,(Py_ssize_t)i))) _error_("Argument " << i+1 << " must be name of option");726 if (!PyUnicode_Check(PyTuple_GetItem(py_tuple,(Py_ssize_t)i))) _error_("Argument " << i+1 << " must be name of option"); 727 727 728 728 FetchData(&name,PyTuple_GetItem(py_tuple,(Py_ssize_t)i)); … … 750 750 PyObject *py_item = NULL; 751 751 752 if (Py String_Check(py_list)){752 if (PyUnicode_Check(py_list)){ 753 753 FetchData(&contourname,py_list); 754 754 contours=ExpRead<double>(contourname); -
TabularUnified issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp ¶
r18453 r19895 20 20 void WriteData(PyObject* py_tuple, int index, int integer){ 21 21 22 PyTuple_SetItem(py_tuple, index, Py Int_FromSsize_t((Py_ssize_t)integer));22 PyTuple_SetItem(py_tuple, index, PyLong_FromSsize_t((Py_ssize_t)integer)); 23 23 24 24 }/*}}}*/ … … 212 212 dict=PyDict_New(); 213 213 214 PyDict_SetItemString(dict,"numsegs" ,Py Int_FromSsize_t((Py_ssize_t)riftstruct->riftsnumsegments[i]));214 PyDict_SetItemString(dict,"numsegs" ,PyLong_FromSsize_t((Py_ssize_t)riftstruct->riftsnumsegments[i])); 215 215 PyDict_SetItemString(dict,"segments" ,PyArrayFromCopiedData(riftstruct->riftsnumsegments[i] ,3,riftstruct->riftssegments[i])); 216 216 PyDict_SetItemString(dict,"pairs" ,PyArrayFromCopiedData(riftstruct->riftsnumpairs[i] ,2,riftstruct->riftspairs[i])); 217 217 PyDict_SetItemString(dict,"tips" ,PyArrayFromCopiedData(1 ,2,&riftstruct->riftstips[2*i])); 218 218 PyDict_SetItemString(dict,"penaltypairs" ,PyArrayFromCopiedData(riftstruct->riftsnumpenaltypairs[i],7,riftstruct->riftspenaltypairs[i])); 219 PyDict_SetItemString(dict,"fill" ,Py Int_FromSsize_t((Py_ssize_t)IceEnum));220 PyDict_SetItemString(dict,"friction" ,Py Int_FromSsize_t((Py_ssize_t)0));219 PyDict_SetItemString(dict,"fill" ,PyLong_FromSsize_t((Py_ssize_t)IceEnum)); 220 PyDict_SetItemString(dict,"friction" ,PyLong_FromSsize_t((Py_ssize_t)0)); 221 221 PyDict_SetItemString(dict,"fraction" ,PyFloat_FromDouble(0.)); 222 222 PyDict_SetItemString(dict,"fractionincrement",PyFloat_FromDouble(0.1));
Note:
See TracChangeset
for help on using the changeset viewer.