MCPcopy Create free account
hub / github.com/boostorg/histogram / BOOST_PYTHON_MODULE

Function BOOST_PYTHON_MODULE

src/python/module.cpp:19–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17void register_histogram();
18
19BOOST_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}

Callers

nothing calls this directly

Calls 2

register_axis_typesFunction · 0.85
register_histogramFunction · 0.85

Tested by

no test coverage detected