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

Wrap afw::math with pybind11

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Story Points:
      10
    • Sprint:
      DRP F16-5
    • Team:
      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

            Hide
            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

            Show
            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
            Hide
            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).

            Show
            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).
            Hide
            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.

            Show
            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.
            Hide
            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.

            Show
            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.
            Hide
            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.

            Show
            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.
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Looks good to me.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Looks good to me.
            Hide
            fred3m Fred Moolekamp added a comment -

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

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

              People

              Assignee:
              fred3m Fred Moolekamp
              Reporter:
              pschella Pim Schellart [X] (Inactive)
              Reviewers:
              Pim Schellart [X] (Inactive), Russell Owen
              Watchers:
              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.