|
7 | 7 | #include <string> |
8 | 8 | #include <vector> |
9 | 9 |
|
10 | | -#include "numpy_cpp.h" |
11 | | - |
12 | 10 | #include "_path.h" |
13 | 11 |
|
14 | 12 | #include "_backend_agg_basic_types.h" |
15 | 13 | #include "py_adaptors.h" |
16 | 14 | #include "py_converters.h" |
17 | | -#include "py_converters_11.h" |
18 | 15 |
|
19 | 16 | namespace py = pybind11; |
20 | 17 | using namespace pybind11::literals; |
@@ -184,9 +181,7 @@ Py_affine_transform(py::array_t<double, py::array::c_style | py::array::forcecas |
184 | 181 | if (vertices_arr.ndim() == 2) { |
185 | 182 | auto vertices = vertices_arr.unchecked<2>(); |
186 | 183 |
|
187 | | - if(!check_trailing_shape(vertices, "vertices", 2)) { |
188 | | - throw py::error_already_set(); |
189 | | - } |
| 184 | + check_trailing_shape(vertices, "vertices", 2); |
190 | 185 |
|
191 | 186 | py::ssize_t dims[] = { vertices.shape(0), 2 }; |
192 | 187 | py::array_t<double> result(dims); |
@@ -267,7 +262,7 @@ Py_cleanup_path(mpl::PathIterator path, agg::trans_affine trans, bool remove_nan |
267 | 262 | bool do_clip = (clip_rect.x1 < clip_rect.x2 && clip_rect.y1 < clip_rect.y2); |
268 | 263 |
|
269 | 264 | std::vector<double> vertices; |
270 | | - std::vector<npy_uint8> codes; |
| 265 | + std::vector<uint8_t> codes; |
271 | 266 |
|
272 | 267 | cleanup_path(path, trans, remove_nans, do_clip, clip_rect, snap_mode, stroke_width, |
273 | 268 | *simplify, return_curves, sketch, vertices, codes); |
@@ -375,14 +370,6 @@ Py_is_sorted_and_has_non_nan(py::object obj) |
375 | 370 |
|
376 | 371 | PYBIND11_MODULE(_path, m) |
377 | 372 | { |
378 | | - auto ia = [m]() -> const void* { |
379 | | - import_array(); |
380 | | - return &m; |
381 | | - }; |
382 | | - if (ia() == NULL) { |
383 | | - throw py::error_already_set(); |
384 | | - } |
385 | | - |
386 | 373 | m.def("point_in_path", &Py_point_in_path, |
387 | 374 | "x"_a, "y"_a, "radius"_a, "path"_a, "trans"_a); |
388 | 375 | m.def("points_in_path", &Py_points_in_path, |
|
0 commit comments