Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7138

Port ndarray to Python 3

    XMLWordPrintable

    Details

    • Story Points:
      0.5
    • Team:
      Data Release Production

      Description

      I just tried to build LSST ndarray on Python 3 and it does not work. It's all going wrong as include/ndarray/swig seems to not be compiling.

      In file included from tests/ndarray-python-mod.cc:25:
      In file included from include/ndarray/swig.h:46:
      In file included from include/ndarray/swig/numpy.h:33:
      include/ndarray/swig/PyConverter.h:175:25: error: use of undeclared identifier 'PyString_AsString'
                  char * cs = PyString_AsString(s.get());
                              ^
      

      That API changed in Python 3 and it probably should be PyBytes_AsString.

      http://stackoverflow.com/questions/22487780/what-do-i-use-instead-of-pystring-asstring-when-loading-a-python-module-in-3-3#22491037

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            Note that this new API is available in Python 2.7 https://docs.python.org/2/c-api/string.html so there is no issue with switching.

            Show
            tjenness Tim Jenness added a comment - Note that this new API is available in Python 2.7 https://docs.python.org/2/c-api/string.html so there is no issue with switching.
            Hide
            tjenness Tim Jenness added a comment -

            Mostly done. Not tested on Python2 yet. Main problem is PyCObject -> PyCapsule transition. Something is incompatible with the destructor.

            Show
            tjenness Tim Jenness added a comment - Mostly done. Not tested on Python2 yet. Main problem is PyCObject -> PyCapsule transition. Something is incompatible with the destructor.
            Hide
            tjenness Tim Jenness added a comment -

            These patches from Jim Bosch look good to me. I will squash the commits that fixed my initial attempt. Tested on Python 2 and 3.

            Show
            tjenness Tim Jenness added a comment - These patches from Jim Bosch look good to me. I will squash the commits that fixed my initial attempt. Tested on Python 2 and 3.
            Hide
            tjenness Tim Jenness added a comment -

            Squashed and merged.

            Show
            tjenness Tim Jenness added a comment - Squashed and merged.

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              tjenness Tim Jenness
              Reviewers:
              Tim Jenness
              Watchers:
              John Swinbank, Pim Schellart [X] (Inactive), Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.