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

Wrap afw::math with pybind11

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • afw
    • None
    • 10
    • DRP F16-5
    • Data Release Production

    Description

      The generated wrappers will live parallel to the Swig wrappers. This ticket only covers the C++ wrappers themselves, not the Python layer on top (which will continue to use the old wrappers) all work will stay on a separate branch and will not be merged to master until DM-6168 is complete.

      The tests included with this ticket are:

      1. minimize
      2. testGaussianProcess
      3. testLeastSquares
      4. spline
      5. interpolate
      6. spatialCell
      7. function

      Attachments

        Issue Links

          Activity

            Russel,
            I heard you were going to be helping out with the pybind11 wrapping, so would mind reviewing the afw.math ticket for me? Nothing else that Pim and I are working on right now is dependent on this being finished, so feel free to take your time as you get up to speed.

            Cheers,
            -Fred

            fred3m Fred Moolekamp added a comment - Russel, I heard you were going to be helping out with the pybind11 wrapping, so would mind reviewing the afw.math ticket for me? Nothing else that Pim and I are working on right now is dependent on this being finished, so feel free to take your time as you get up to speed. Cheers, -Fred

            Ok, review mostly done. Looks good. Although I have not looked in detail at the iterator for SpatialCell yet. I have the feeling that that could be done in C++, and the Python looks somewhat confusing to me with looping over `.begin()` and the like (but that may just be me being tired).

            pschella Pim Schellart [X] (Inactive) added a comment - Ok, review mostly done. Looks good. Although I have not looked in detail at the iterator for SpatialCell yet. I have the feeling that that could be done in C++, and the Python looks somewhat confusing to me with looping over `.begin()` and the like (but that may just be me being tired).

            The pybind11 changes that should allow me to pass numpy arrays to std::vector's does not appear to be working properly. The tests still fail if I don't convert numpy arrays to lists.

            fred3m Fred Moolekamp added a comment - The pybind11 changes that should allow me to pass numpy arrays to std::vector's does not appear to be working properly. The tests still fail if I don't convert numpy arrays to lists.

            I agree that the iterator is not ideal but it is an exact duplicate of what SWIG was doing. I couldn't seem to get the pybind11 iterator wrapper to work properly since the C++ code does not iterate over all values but skips "bad" entries.

            fred3m Fred Moolekamp added a comment - I agree that the iterator is not ideal but it is an exact duplicate of what SWIG was doing. I couldn't seem to get the pybind11 iterator wrapper to work properly since the C++ code does not iterate over all values but skips "bad" entries.

            If it's an exact replica of Swig's solution than it is fine. We will not have a regression. We can always revisit later if it turns out to be a bottleneck.
            I have not pulled in the latest pybind11 master yet. I will do that now.

            pschella Pim Schellart [X] (Inactive) added a comment - If it's an exact replica of Swig's solution than it is fine. We will not have a regression. We can always revisit later if it turns out to be a bottleneck. I have not pulled in the latest pybind11 master yet. I will do that now.

            Looks good to me.

            pschella Pim Schellart [X] (Inactive) added a comment - Looks good to me.

            Merged afw::math tests into the main afw pybind11 branch (DM-6168)

            fred3m Fred Moolekamp added a comment - Merged afw::math tests into the main afw pybind11 branch ( DM-6168 )

            People

              fred3m Fred Moolekamp
              pschella Pim Schellart [X] (Inactive)
              Pim Schellart [X] (Inactive), Russell Owen
              Fred Moolekamp, Pim Schellart [X] (Inactive), Russell Owen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.