| 93 | }; |
| 94 | |
| 95 | static bp::object array_interface(const pyhistogram& self) { |
| 96 | bp::dict d; |
| 97 | bp::list shapes; |
| 98 | bp::list strides; |
| 99 | auto& b = self.storage_.buffer_; |
| 100 | d["typestr"] = bh::detail::apply(dtype_visitor(), b, shapes, strides); |
| 101 | for (std::size_t i = 0; i < self.dim(); ++i) { |
| 102 | if (i > 0) strides.append(strides[-1] * shapes[-1]); |
| 103 | shapes.append(self.axis(i).shape()); |
| 104 | } |
| 105 | if (self.dim() == 0) shapes.append(0); |
| 106 | d["shape"] = bp::tuple(shapes); |
| 107 | d["strides"] = bp::tuple(strides); |
| 108 | d["data"] = bh::detail::apply(data_visitor(), b, shapes, strides); |
| 109 | return d; |
| 110 | } |
| 111 | }; |
| 112 | } // namespace histogram |
| 113 | } // namespace boost |
nothing calls this directly
no test coverage detected