An early version of the pybind11 stack is now available for testing!

This release is for testing only, so do not rely on it for your daily use.

It uses pybind11 instead of Swig to generate Python wrappers around our C++ code.

While care has been taken to reduce API changes from the Swig wrappers to an absolute minimum, there are still some changes. Notably:

  • enums are actual types and no longer just ints in Python.
    While this is intrinsically safer, in some cases explicit casts to int are needed.

  • functions that accept or return std::vector / std::list, std::map or std::pair / std::tuple now return standard Python list, dict or tuple types, and accept any Python iterable.

Currently all packages (except meas_modelfit) up to, and including, ci_hsc have been ported.

The easiest way to try it out is to use lsstsw and issue:

rebuild -r tickets/DM-8467 lsst_distrib

(and be sure to use the build tag that rebuild reports when setting up your package)

Feel free to report any problems you find on this thread.


Note that some pybind11 wrappers only wrap “true division”. Thus some code may require from __future__ import division in order to work without raising an exception under python 2. It is part of our standard that all python code should have this import statement, but not all of it does.