Skip to content

Commit

Permalink
Merge pull request #444 from lsst/tickets/DM-18678-afw
Browse files Browse the repository at this point in the history
DM-18678: Support boost 1.69 removal of gil_all.hpp
  • Loading branch information
timj committed Mar 28, 2019
2 parents 41c8d5d + 9b2577a commit 81fa8e0
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 13 deletions.
6 changes: 6 additions & 0 deletions examples/timePixelAccessGil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@
#include <ctime>

#include "boost/format.hpp"

#include "boost/version.hpp"
#if BOOST_VERSION < 106900
#include "boost/gil/gil_all.hpp"
#else
#include "boost/gil.hpp"
#endif

template <class ImageT>
void timePixelAccess(ImageT const &image, float const pix, int nIter) {
Expand Down
1 change: 1 addition & 0 deletions include/lsst/afw/fits.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <climits>
#include <string>
#include <set>

#include <boost/format.hpp>

Expand Down
5 changes: 5 additions & 0 deletions include/lsst/afw/image/lsstGil.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
#pragma warning(disable : 304)
#endif

#include "boost/version.hpp"
#if BOOST_VERSION < 106900
#include "boost/gil/gil_all.hpp"
#else
#include "boost/gil.hpp"
#endif

#if defined(__ICC)
#pragma warning(pop)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/afw/cameraGeom/camera/camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PYBIND11_MODULE(camera, mod){
py::object pupilFactoryClass
) {
std::string pupilFactoryName = "lsst.afw.cameraGeom.pupil.PupilFactory";
if (pupilFactoryClass != py::none()) {
if (!pupilFactoryClass.is(py::none())) {
pupilFactoryName = py::str("{}.{}").format(
pupilFactoryClass.attr("__module__"),
pupilFactoryClass.attr("__name__")
Expand Down
24 changes: 12 additions & 12 deletions python/lsst/afw/image/readers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void declareSinglePlaneMethods(py::class_<Class, Args...> & cls) {
"readArray",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -101,7 +101,7 @@ void declareMultiPlaneMethods(py::class_<Class, Args...> & cls) {
"readImage",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readImageDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -118,7 +118,7 @@ void declareMultiPlaneMethods(py::class_<Class, Args...> & cls) {
"readImageArray",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readImageDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -135,7 +135,7 @@ void declareMultiPlaneMethods(py::class_<Class, Args...> & cls) {
"readMask",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool conformMasks,
bool allowUnsafe, py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readMaskDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -153,7 +153,7 @@ void declareMultiPlaneMethods(py::class_<Class, Args...> & cls) {
"readMaskArray",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readMaskDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -170,7 +170,7 @@ void declareMultiPlaneMethods(py::class_<Class, Args...> & cls) {
"readVariance",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readVarianceDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -187,7 +187,7 @@ void declareMultiPlaneMethods(py::class_<Class, Args...> & cls) {
"readVarianceArray",
[](Class & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readVarianceDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -210,7 +210,7 @@ void declareImageFitsReader(py::module & mod) {
"read",
[](ImageFitsReader & self, lsst::geom::Box2I const & bbox, ImageOrigin origin, bool allowUnsafe,
py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -233,7 +233,7 @@ void declareMaskFitsReader(py::module & mod) {
"read",
[](MaskFitsReader & self, lsst::geom::Box2I const & bbox, ImageOrigin origin,
bool conformMasks, bool allowUnsafe, py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readDType());
}
return utils::python::TemplateInvoker().apply(
Expand Down Expand Up @@ -264,7 +264,7 @@ void declareMaskedImageFitsReader(py::module & mod) {
"read",
[](MaskedImageFitsReader & self, lsst::geom::Box2I const & bbox, ImageOrigin origin,
bool conformMasks, bool needAllHdus, bool allowUnsafe, py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readImageDType());
}
return utils::python::TemplateInvoker().apply(
Expand Down Expand Up @@ -302,7 +302,7 @@ void declareExposureFitsReader(py::module & mod) {
"readMaskedImage",
[](ExposureFitsReader & self, lsst::geom::Box2I const & bbox, ImageOrigin origin,
bool conformMasks, bool allowUnsafe, py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readImageDType());
}
return utils::python::TemplateInvoker().apply(
Expand All @@ -320,7 +320,7 @@ void declareExposureFitsReader(py::module & mod) {
"read",
[](ExposureFitsReader & self, lsst::geom::Box2I const & bbox, ImageOrigin origin,
bool conformMasks, bool allowUnsafe, py::object dtype) {
if (dtype == py::none()) {
if (dtype.is(py::none())) {
dtype = py::dtype(self.readImageDType());
}
return utils::python::TemplateInvoker().apply(
Expand Down
6 changes: 6 additions & 0 deletions src/image/DecoratedImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@

#include "boost/format.hpp"
#include "boost/mpl/vector.hpp"

#include "boost/version.hpp"
#if BOOST_VERSION < 106900
#include "boost/gil/gil_all.hpp"
#else
#include "boost/gil.hpp"
#endif

#include "lsst/pex/exceptions.h"
#include "lsst/afw/fits.h"
Expand Down
6 changes: 6 additions & 0 deletions src/image/Image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@
#pragma clang diagnostic pop
#include "boost/format.hpp"
#include "boost/filesystem/path.hpp"

#include "boost/version.hpp"
#if BOOST_VERSION < 106900
#include "boost/gil/gil_all.hpp"
#else
#include "boost/gil.hpp"
#endif

#include "lsst/pex/exceptions.h"
#include "lsst/afw/geom/wcsUtils.h"
Expand Down

0 comments on commit 81fa8e0

Please sign in to comment.