Changeset 19895


Ignore:
Timestamp:
12/16/15 05:39:20 (9 years ago)
Author:
bdef
Message:

NEW:Adding directory to hold the python 3 implementation of the interface

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  
    2323        IssmDouble  value   = 0.;
    2424        char       *svalue   = NULL;
     25
    2526
    2627        /*Boot module: */
     
    162163         WriteData(VALUE,value);
    163164
     165
    164166        /*Clean up*/
    165167        xDelete<char>(name);
     
    168170        /*end module: */
    169171        MODULEEND();
     172
    170173}
  • TabularUnified issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.h

    r19753 r19895  
    55#ifndef _ISSMCONFIG_H
    66#define _ISSMCONFIG_H
     7
    78
    89#ifdef HAVE_CONFIG_H
  • TabularUnified issm/trunk-jpl/src/wrappers/python/include/pythonincludes.h

    r13750 r19895  
    1111#ifdef _HAVE_PYTHON_
    1212
    13 #if _PYTHON_MAJOR_ == 2
     13#if _PYTHON_MAJOR_ >= 2
    1414#undef NPY_NO_DEPRECATED_API
    1515#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
  • TabularUnified issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp

    r19893 r19895  
    2424        if      (PyFloat_Check(py_float))
    2525                dscalar=PyFloat_AsDouble(py_float);
    26         else if (PyInt_Check(py_float))
    27                 dscalar=(double)PyInt_AsLong(py_float);
     26        else if (PyLong_Check(py_float))
     27                dscalar=(double)PyLong_AsLong(py_float);
    2828        else if (PyLong_Check(py_float))
    2929                dscalar=PyLong_AsDouble(py_float);
     
    4747
    4848        /*return internal value: */
    49         if      (PyInt_Check(py_long))
    50                 iscalar=(int)PyInt_AsLong(py_long);
     49        if      (PyLong_Check(py_long))
     50                iscalar=(int)PyLong_AsLong(py_long);
    5151        else if (PyLong_Check(py_long))
    5252                iscalar=(int)PyLong_AsLong(py_long);
     
    7474        if      (PyBool_Check(py_boolean))
    7575                bscalar=(bool)PyLong_AsLong(py_boolean);
    76         else if (PyInt_Check(py_boolean))
    77                 bscalar=(bool)PyInt_AsLong(py_boolean);
     76        else if (PyLong_Check(py_boolean))
     77                bscalar=(bool)PyLong_AsLong(py_boolean);
    7878        else if (PyLong_Check(py_boolean))
    7979                bscalar=(bool)PyLong_AsLong(py_boolean);
     
    724724        /*Fetch all options*/
    725725        for (int i=istart; i<nrhs; i=i+2){
    726                 if (!PyString_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");
    727727
    728728                FetchData(&name,PyTuple_GetItem(py_tuple,(Py_ssize_t)i));
     
    750750        PyObject        *py_item     = NULL;
    751751
    752         if (PyString_Check(py_list)){
     752        if (PyUnicode_Check(py_list)){
    753753                FetchData(&contourname,py_list);
    754754                contours=ExpRead<double>(contourname);
  • TabularUnified issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp

    r18453 r19895  
    2020void WriteData(PyObject* py_tuple, int index, int integer){
    2121
    22         PyTuple_SetItem(py_tuple, index, PyInt_FromSsize_t((Py_ssize_t)integer));
     22        PyTuple_SetItem(py_tuple, index, PyLong_FromSsize_t((Py_ssize_t)integer));
    2323
    2424}/*}}}*/
     
    212212                dict=PyDict_New();
    213213
    214                 PyDict_SetItemString(dict,"numsegs"          ,PyInt_FromSsize_t((Py_ssize_t)riftstruct->riftsnumsegments[i]));
     214                PyDict_SetItemString(dict,"numsegs"          ,PyLong_FromSsize_t((Py_ssize_t)riftstruct->riftsnumsegments[i]));
    215215                PyDict_SetItemString(dict,"segments"         ,PyArrayFromCopiedData(riftstruct->riftsnumsegments[i]    ,3,riftstruct->riftssegments[i]));
    216216                PyDict_SetItemString(dict,"pairs"            ,PyArrayFromCopiedData(riftstruct->riftsnumpairs[i]       ,2,riftstruct->riftspairs[i]));
    217217                PyDict_SetItemString(dict,"tips"             ,PyArrayFromCopiedData(1                                  ,2,&riftstruct->riftstips[2*i]));
    218218                PyDict_SetItemString(dict,"penaltypairs"     ,PyArrayFromCopiedData(riftstruct->riftsnumpenaltypairs[i],7,riftstruct->riftspenaltypairs[i]));
    219                 PyDict_SetItemString(dict,"fill"             ,PyInt_FromSsize_t((Py_ssize_t)IceEnum));
    220                 PyDict_SetItemString(dict,"friction"         ,PyInt_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));
    221221                PyDict_SetItemString(dict,"fraction"         ,PyFloat_FromDouble(0.));
    222222                PyDict_SetItemString(dict,"fractionincrement",PyFloat_FromDouble(0.1));
Note: See TracChangeset for help on using the changeset viewer.