Except as noted. the changes are trivial: merely replace PYBIND11_PLUGIN with the simpler PYBIND11_MODULE (which still works, but produces compiler warnings). If the reviewer is comfortable not looking at all those I'm fine with that. If I missed any, the code will still work but will produce compiler warnings.
The more interesting packages are as follows:
afw, meas_algorithms, pex_logging, pex_policy and sphgeom
These all defined "placement new custom constructors" (({__init__}} methods), which are deprecated .
That change is mechanical but a bit trickier. Most common errors, such as forgetting to add return, are caught by the compiler. However, forgetting to delete the existing self argument can only be caught by the compiler if the arguments are named (which they are, in most cases). In summary, this change is worth a closer look.
Also a few packages used a == b to compare pybind11 python objects, which is deprecated in favor of a.is(b) so I updated those.
In a few packages I also ran clang-format on the wrappers (as a separate commit).
daf_base
The pickle support for PropertyList was written as a pybind11 wrapper that called into a Python function. This was rather complicated and caused deprecation warnings when loading the module. Rather than modernize that code, I replaced it with a simple pure Python __reduce__ method on PropertyList, as per Jim Bosch's excellent suggestion. I then added pickle support to PropertySet in the same way, including tests similar to those for PropertyList.
I also reworked two public functions getstate and setstate that were used in one other package: daf_persistence to persist property containers. The functions had isinstance switches to handle both PropertySet and PropertyList but the code that called those functions always knew the type. Also I felt the names were too ambiguous. So I broke them into 4 functions: getPropertySetState, getPropertyListState, setPropertySetState, and setPropertyListState.
daf_persistence
As described just above, this was adjusted to use the new public functions for getting and setting property container state – a very small code change.
pybind11
The usual 3rd party package update.
Except as noted. the changes are trivial: merely replace PYBIND11_PLUGIN with the simpler PYBIND11_MODULE (which still works, but produces compiler warnings). If the reviewer is comfortable not looking at all those I'm fine with that. If I missed any, the code will still work but will produce compiler warnings.
The more interesting packages are as follows:
afw, meas_algorithms, pex_logging, pex_policy and sphgeom
These all defined "placement new custom constructors" (({__init__}} methods), which are deprecated .
That change is mechanical but a bit trickier. Most common errors, such as forgetting to add return, are caught by the compiler. However, forgetting to delete the existing self argument can only be caught by the compiler if the arguments are named (which they are, in most cases). In summary, this change is worth a closer look.
Also a few packages used a == b to compare pybind11 python objects, which is deprecated in favor of a.is(b) so I updated those.
In a few packages I also ran clang-format on the wrappers (as a separate commit).
daf_base
The pickle support for PropertyList was written as a pybind11 wrapper that called into a Python function. This was rather complicated and caused deprecation warnings when loading the module. Rather than modernize that code, I replaced it with a simple pure Python __reduce__ method on PropertyList, as per Jim Bosch's excellent suggestion. I then added pickle support to PropertySet in the same way, including tests similar to those for PropertyList.
I also reworked two public functions getstate and setstate that were used in one other package: daf_persistence to persist property containers. The functions had isinstance switches to handle both PropertySet and PropertyList but the code that called those functions always knew the type. Also I felt the names were too ambiguous. So I broke them into 4 functions: getPropertySetState, getPropertyListState, setPropertySetState, and setPropertyListState.
daf_persistence
As described just above, this was adjusted to use the new public functions for getting and setting property container state – a very small code change.
pybind11
The usual 3rd party package update.