| 17 | void register_histogram(); |
| 18 | |
| 19 | BOOST_PYTHON_MODULE(histogram) { |
| 20 | using namespace boost::python; |
| 21 | |
| 22 | register_exception_translator<std::out_of_range>( |
| 23 | [](const std::out_of_range& e) { PyErr_SetString(PyExc_IndexError, e.what()); }); |
| 24 | |
| 25 | scope current; |
| 26 | #ifdef HAVE_NUMPY |
| 27 | numpy::initialize(); |
| 28 | current.attr("HAVE_NUMPY") = true; |
| 29 | #else |
| 30 | current.attr("HAVE_NUMPY") = false; |
| 31 | #endif |
| 32 | object axis_module = object(borrowed(PyImport_AddModule("histogram.axis"))); |
| 33 | current.attr("axis") = axis_module; |
| 34 | { |
| 35 | scope current = axis_module; |
| 36 | register_axis_types(); |
| 37 | } |
| 38 | register_histogram(); |
| 39 | } |
nothing calls this directly
no test coverage detected