Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-14864: Make afw pybind11 wrappers compatible with pybind11 2.2 #372

Merged
merged 6 commits into from
Jul 18, 2018

Commits on Jul 13, 2018

  1. Fix an error in footPrintSet pybind11

    Automatic conversion of ``std::shared_ptr<T>`` is not possible when ``T`` is
    not directly registered with ``py::class_<T>`` (e.g. ``std::shared_ptr<int>``
    or ``std::shared_ptr<std::vector<T>>`` are not automatically convertible).
    
    In this case all we need to do is get rid of an overload that was
    not being used. But I also made the existing overload more efficient
    by using std::move (as suggested by Pim Schellart) and simplified
    the associated code comments.
    r-owen committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    0615bd3 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2018

  1. Fix error in background.cc

    declareGetImage should wrap Background::getImage
    but not BackgroundMI::getImage (since that is inherited).
    pybind11 2.2 rejected the old code.
    r-owen committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    da7472f View commit details
    Browse the repository at this point in the history
  2. Fix using Mask as a default argument in Image

    Still to fix:
        from .image import *
    E   ImportError: arg(): could not convert default argument 'planeDefs: std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, int> > >' in method '<class 'lsst.afw.image.image.image.MaskX'>.__init__' into a Python object (type not registered yet?)
    
    which appears to be this bit of code:
        cls.def(py::init<unsigned int, unsigned int, typename Mask<MaskPixelT>::MaskPlaneDict const &>(),
                "width"_a, "height"_a, "planeDefs"_a = typename Mask<MaskPixelT>::MaskPlaneDict());
    
    note that MaskPlaneDict is defined as follows in Mask.h:
    
        typedef std::map<std::string, int> MaskPlaneDict;
    r-owen committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    3ce7196 View commit details
    Browse the repository at this point in the history
  3. Modernize pybind11 wrappers for most submodules

    Including coord, cameraGeom, display, detection, fits,
    geom, math, math.detail and also the wrapper in test/.
    Use addUnderscore=False to SConscript.
    Use <x>Continued.py and subdirectories where appropriate.
    Use @continueClass where appropriate.
    Delete unused wrappers, which had no content and were not built.
    Change the way the code pulled the contents of lsst.afw.math.detail
    into lsst.afw.math to avoid the `convolve` module
    (formerly `_convolve`) shadowing the `convolve` function.
    r-owen committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    692ac55 View commit details
    Browse the repository at this point in the history
  4. Simplify vector version of statisticsStack

    Make it accept a vector of vectors instead of a vector of
    shared_ptr to vectors,
    and return a vector instead of a shared pointer to a vector.
    r-owen committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    d350bd7 View commit details
    Browse the repository at this point in the history
  5. Add missing imports to pybind11 wrappers

    pybind11 2.2 appears to be much pickier than 2.1 about requiring
    wrapper modules to import what they need.
    r-owen committed Jul 18, 2018
    Configuration menu
    Copy the full SHA
    4c7bb7d View commit details
    Browse the repository at this point in the history