From 206818fad4a02d032f9d58cf10690579001b701d Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Fri, 24 Mar 2017 23:41:51 +0100 Subject: [PATCH] hide numpy-stuff --- src/python/histogram.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/histogram.cpp b/src/python/histogram.cpp index e3ec4973..c72173d3 100644 --- a/src/python/histogram.cpp +++ b/src/python/histogram.cpp @@ -269,6 +269,7 @@ histogram_repr(const dynamic_histogram<>& h) { } struct storage_access { +#ifdef HAVE_NUMPY static python::object array_interface(dynamic_histogram<>& self) { @@ -333,6 +334,7 @@ struct storage_access { d["data"] = python::make_tuple(reinterpret_cast(b.ptr_), false); return d; } +#endif }; void register_histogram() @@ -350,8 +352,10 @@ void register_histogram() "\nthe dimensions of the dynamic_histogram<>.") // shadowed C++ ctors .def(init&>()) +#ifdef HAVE_NUMPY .add_property("__array_interface__", &storage_access::array_interface) +#endif .def("__len__", &dynamic_histogram<>::dim) .def("__getitem__", histogram_axis) .def("axis", histogram_axis,