diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index 335e40971948..aec7676b7951 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -128,11 +128,11 @@ RendererAgg::restore_region(BufferRegion ®ion, int xx1, int yy1, int xx2, int rendererBase.copy_from(rbuf, &rect, x, y); } -bool RendererAgg::render_clippath(py::PathIterator &clippath, +bool RendererAgg::render_clippath(mpl::PathIterator &clippath, const agg::trans_affine &clippath_trans, e_snap_mode snap_mode) { - typedef agg::conv_transform transformed_path_t; + typedef agg::conv_transform transformed_path_t; typedef PathNanRemover nan_removed_t; /* Unlike normal Paths, the clip path cannot be clipped to the Figure bbox, * because it needs to remain a complete closed path, so there is no diff --git a/src/_backend_agg.h b/src/_backend_agg.h index dd73aecde0f2..0319b449dce2 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -244,7 +244,7 @@ class RendererAgg template void set_clipbox(const agg::rect_d &cliprect, R &rasterizer); - bool render_clippath(py::PathIterator &clippath, const agg::trans_affine &clippath_trans, e_snap_mode snap_mode); + bool render_clippath(mpl::PathIterator &clippath, const agg::trans_affine &clippath_trans, e_snap_mode snap_mode); template void _draw_path(PathIteratorType &path, bool has_clippath, const facepair_t &face, GCAgg &gc); @@ -340,11 +340,11 @@ RendererAgg::_draw_path(path_t &path, bool has_clippath, const facepair_t &face, rendererBase.reset_clipping(true); // Create and transform the path - typedef agg::conv_transform hatch_path_trans_t; + typedef agg::conv_transform hatch_path_trans_t; typedef agg::conv_curve hatch_path_curve_t; typedef agg::conv_stroke hatch_path_stroke_t; - py::PathIterator hatch_path(gc.hatchpath); + mpl::PathIterator hatch_path(gc.hatchpath); agg::trans_affine hatch_trans; hatch_trans *= agg::trans_affine_scaling(1.0, -1.0); hatch_trans *= agg::trans_affine_translation(0.0, 1.0); @@ -447,7 +447,7 @@ template inline void RendererAgg::draw_path(GCAgg &gc, PathIterator &path, agg::trans_affine &trans, agg::rgba &color) { - typedef agg::conv_transform transformed_path_t; + typedef agg::conv_transform transformed_path_t; typedef PathNanRemover nan_removed_t; typedef PathClipper clipped_t; typedef PathSnapper snapped_t; @@ -490,7 +490,7 @@ inline void RendererAgg::draw_markers(GCAgg &gc, agg::trans_affine &trans, agg::rgba color) { - typedef agg::conv_transform transformed_path_t; + typedef agg::conv_transform transformed_path_t; typedef PathNanRemover nan_removed_t; typedef PathSnapper snap_t; typedef agg::conv_curve curve_t; diff --git a/src/_backend_agg_basic_types.h b/src/_backend_agg_basic_types.h index 21a84bb6a5ae..95c7a3ca5a3c 100644 --- a/src/_backend_agg_basic_types.h +++ b/src/_backend_agg_basic_types.h @@ -14,7 +14,7 @@ struct ClipPath { - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; }; @@ -103,7 +103,7 @@ class GCAgg e_snap_mode snap_mode; - py::PathIterator hatchpath; + mpl::PathIterator hatchpath; agg::rgba hatch_color; double hatch_linewidth; diff --git a/src/_backend_agg_wrapper.cpp b/src/_backend_agg_wrapper.cpp index 02832f1c3e69..7ff344f6c2e8 100644 --- a/src/_backend_agg_wrapper.cpp +++ b/src/_backend_agg_wrapper.cpp @@ -209,7 +209,7 @@ static void PyRendererAgg_dealloc(PyRendererAgg *self) static PyObject *PyRendererAgg_draw_path(PyRendererAgg *self, PyObject *args) { GCAgg gc; - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; PyObject *faceobj = NULL; agg::rgba face; @@ -263,9 +263,9 @@ static PyObject *PyRendererAgg_draw_text_image(PyRendererAgg *self, PyObject *ar PyObject *PyRendererAgg_draw_markers(PyRendererAgg *self, PyObject *args) { GCAgg gc; - py::PathIterator marker_path; + mpl::PathIterator marker_path; agg::trans_affine marker_path_trans; - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; PyObject *faceobj = NULL; agg::rgba face; @@ -328,7 +328,7 @@ PyRendererAgg_draw_path_collection(PyRendererAgg *self, PyObject *args) { GCAgg gc; agg::trans_affine master_transform; - py::PathGenerator paths; + mpl::PathGenerator paths; numpy::array_view transforms; numpy::array_view offsets; agg::trans_affine offset_trans; diff --git a/src/_image_wrapper.cpp b/src/_image_wrapper.cpp index b18e93a50fb3..716116c0ba56 100644 --- a/src/_image_wrapper.cpp +++ b/src/_image_wrapper.cpp @@ -4,6 +4,8 @@ #include "_image_resample.h" #include "py_converters_11.h" +namespace py = pybind11; +using namespace pybind11::literals; /********************************************************************** * Free functions @@ -46,8 +48,8 @@ radius: float, default: 1 )"""; -static pybind11::array_t -_get_transform_mesh(const pybind11::object& transform, const pybind11::ssize_t *dims) +static py::array_t +_get_transform_mesh(const py::object& transform, const py::ssize_t *dims) { /* TODO: Could we get away with float, rather than double, arrays here? */ @@ -58,8 +60,8 @@ _get_transform_mesh(const pybind11::object& transform, const pybind11::ssize_t * // If attribute doesn't exist, raises Python AttributeError auto inverse = transform.attr("inverted")(); - pybind11::ssize_t mesh_dims[2] = {dims[0]*dims[1], 2}; - pybind11::array_t input_mesh(mesh_dims); + py::ssize_t mesh_dims[2] = {dims[0]*dims[1], 2}; + py::array_t input_mesh(mesh_dims); auto p = input_mesh.mutable_data(); for (auto y = 0; y < dims[0]; ++y) { @@ -72,7 +74,7 @@ _get_transform_mesh(const pybind11::object& transform, const pybind11::ssize_t * auto output_mesh = inverse.attr("transform")(input_mesh); auto output_mesh_array = - pybind11::array_t(output_mesh); + py::array_t(output_mesh); if (output_mesh_array.ndim() != 2) { throw std::runtime_error( @@ -84,12 +86,12 @@ _get_transform_mesh(const pybind11::object& transform, const pybind11::ssize_t * } -// Using generic pybind::array for input and output arrays rather than the more usual -// pybind::array_t as function supports multiple array dtypes. +// Using generic py::array for input and output arrays rather than the more usual +// py::array_t as this function supports multiple array dtypes. static void -image_resample(pybind11::array input_array, - pybind11::array& output_array, - const pybind11::object& transform, +image_resample(py::array input_array, + py::array& output_array, + const py::object& transform, interpolation_e interpolation, bool resample_, // Avoid name clash with resample() function float alpha, @@ -111,7 +113,7 @@ image_resample(pybind11::array input_array, } // Ensure input array is contiguous, regardless of dtype - input_array = pybind11::array::ensure(input_array, pybind11::array::c_style); + input_array = py::array::ensure(input_array, py::array::c_style); // Validate output array auto out_ndim = output_array.ndim(); @@ -132,7 +134,7 @@ image_resample(pybind11::array input_array, throw std::invalid_argument("Input and output arrays have mismatched types"); } - if ((output_array.flags() & pybind11::array::c_style) == 0) { + if ((output_array.flags() & py::array::c_style) == 0) { throw std::invalid_argument("Output array must be C-contiguous"); } @@ -150,14 +152,14 @@ image_resample(pybind11::array input_array, // Only used if transform is not affine. // Need to keep it in scope for the duration of this function. - pybind11::array_t transform_mesh; + py::array_t transform_mesh; // Validate transform if (transform.is_none()) { params.is_affine = true; } else { // Raises Python AttributeError if no such attribute or TypeError if cast fails - bool is_affine = pybind11::cast(transform.attr("is_affine")); + bool is_affine = py::cast(transform.attr("is_affine")); if (is_affine) { convert_trans_affine(transform, params.affine); @@ -171,20 +173,20 @@ image_resample(pybind11::array input_array, if (auto resampler = (ndim == 2) ? ( - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : nullptr) : ( // ndim == 3 - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : - (dtype.is(pybind11::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : + (dtype.is(py::dtype::of())) ? resample : nullptr)) { Py_BEGIN_ALLOW_THREADS resampler( @@ -199,7 +201,7 @@ image_resample(pybind11::array input_array, PYBIND11_MODULE(_image, m) { - pybind11::enum_(m, "_InterpolationType") + py::enum_(m, "_InterpolationType") .value("NEAREST", NEAREST) .value("BILINEAR", BILINEAR) .value("BICUBIC", BICUBIC) @@ -220,13 +222,13 @@ PYBIND11_MODULE(_image, m) { .export_values(); m.def("resample", &image_resample, - pybind11::arg("input_array"), - pybind11::arg("output_array"), - pybind11::arg("transform"), - pybind11::arg("interpolation") = interpolation_e::NEAREST, - pybind11::arg("resample") = false, - pybind11::arg("alpha") = 1, - pybind11::arg("norm") = false, - pybind11::arg("radius") = 1, + "input_array"_a, + "output_array"_a, + "transform"_a, + "interpolation"_a = interpolation_e::NEAREST, + "resample"_a = false, + "alpha"_a = 1, + "norm"_a = false, + "radius"_a = 1, image_resample__doc__); } diff --git a/src/_path.h b/src/_path.h index 387a0a6737f4..10a1101612ae 100644 --- a/src/_path.h +++ b/src/_path.h @@ -856,7 +856,7 @@ inline bool segments_intersect(const double &x1, template bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2) { - typedef PathNanRemover no_nans_t; + typedef PathNanRemover no_nans_t; typedef agg::conv_curve curve_t; if (p1.total_vertices() < 2 || p2.total_vertices() < 2) { @@ -920,7 +920,7 @@ bool path_intersects_rectangle(PathIterator &path, double rect_x2, double rect_y2, bool filled) { - typedef PathNanRemover no_nans_t; + typedef PathNanRemover no_nans_t; typedef agg::conv_curve curve_t; if (path.total_vertices() == 0) { @@ -966,7 +966,7 @@ void convert_path_to_polygons(PathIterator &path, int closed_only, std::vector &result) { - typedef agg::conv_transform transformed_path_t; + typedef agg::conv_transform transformed_path_t; typedef PathNanRemover nan_removal_t; typedef PathClipper clipped_t; typedef PathSimplifier simplify_t; @@ -1032,7 +1032,7 @@ void cleanup_path(PathIterator &path, std::vector &vertices, std::vector &codes) { - typedef agg::conv_transform transformed_path_t; + typedef agg::conv_transform transformed_path_t; typedef PathNanRemover nan_removal_t; typedef PathClipper clipped_t; typedef PathSnapper snapped_t; @@ -1189,7 +1189,7 @@ bool convert_to_string(PathIterator &path, std::string& buffer) { size_t buffersize; - typedef agg::conv_transform transformed_path_t; + typedef agg::conv_transform transformed_path_t; typedef PathNanRemover nan_removal_t; typedef PathClipper clipped_t; typedef PathSimplifier simplify_t; diff --git a/src/_path_wrapper.cpp b/src/_path_wrapper.cpp index 369d9e030880..fc4d35da6309 100644 --- a/src/_path_wrapper.cpp +++ b/src/_path_wrapper.cpp @@ -35,7 +35,7 @@ const char *Py_point_in_path__doc__ = static PyObject *Py_point_in_path(PyObject *self, PyObject *args) { double x, y, r; - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; bool result; @@ -68,7 +68,7 @@ static PyObject *Py_points_in_path(PyObject *self, PyObject *args) { numpy::array_view points; double r; - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; if (!PyArg_ParseTuple(args, @@ -97,7 +97,7 @@ const char *Py_update_path_extents__doc__ = static PyObject *Py_update_path_extents(PyObject *self, PyObject *args) { - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; agg::rect_d rect; numpy::array_view minpos; @@ -177,7 +177,7 @@ const char *Py_get_path_collection_extents__doc__ = static PyObject *Py_get_path_collection_extents(PyObject *self, PyObject *args) { agg::trans_affine master_transform; - py::PathGenerator paths; + mpl::PathGenerator paths; numpy::array_view transforms; numpy::array_view offsets; agg::trans_affine offset_trans; @@ -227,7 +227,7 @@ static PyObject *Py_point_in_path_collection(PyObject *self, PyObject *args) { double x, y, radius; agg::trans_affine master_transform; - py::PathGenerator paths; + mpl::PathGenerator paths; numpy::array_view transforms; numpy::array_view offsets; agg::trans_affine offset_trans; @@ -280,9 +280,9 @@ const char *Py_path_in_path__doc__ = static PyObject *Py_path_in_path(PyObject *self, PyObject *args) { - py::PathIterator a; + mpl::PathIterator a; agg::trans_affine atrans; - py::PathIterator b; + mpl::PathIterator b; agg::trans_affine btrans; bool result; @@ -314,7 +314,7 @@ const char *Py_clip_path_to_rect__doc__ = static PyObject *Py_clip_path_to_rect(PyObject *self, PyObject *args) { - py::PathIterator path; + mpl::PathIterator path; agg::rect_d rect; bool inside; std::vector result; @@ -407,8 +407,8 @@ const char *Py_path_intersects_path__doc__ = static PyObject *Py_path_intersects_path(PyObject *self, PyObject *args, PyObject *kwds) { - py::PathIterator p1; - py::PathIterator p2; + mpl::PathIterator p1; + mpl::PathIterator p2; agg::trans_affine t1; agg::trans_affine t2; int filled = 0; @@ -453,7 +453,7 @@ const char *Py_path_intersects_rectangle__doc__ = static PyObject *Py_path_intersects_rectangle(PyObject *self, PyObject *args, PyObject *kwds) { - py::PathIterator path; + mpl::PathIterator path; double rect_x1, rect_y1, rect_x2, rect_y2; bool filled = false; const char *names[] = { "path", "rect_x1", "rect_y1", "rect_x2", "rect_y2", "filled", NULL }; @@ -489,7 +489,7 @@ const char *Py_convert_path_to_polygons__doc__ = static PyObject *Py_convert_path_to_polygons(PyObject *self, PyObject *args, PyObject *kwds) { - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; double width = 0.0, height = 0.0; int closed_only = 1; @@ -524,7 +524,7 @@ const char *Py_cleanup_path__doc__ = static PyObject *Py_cleanup_path(PyObject *self, PyObject *args) { - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; bool remove_nans; agg::rect_d clip_rect; @@ -631,7 +631,7 @@ const char *Py_convert_to_string__doc__ = static PyObject *Py_convert_to_string(PyObject *self, PyObject *args) { - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; agg::rect_d cliprect; PyObject *simplifyobj; diff --git a/src/_ttconv.cpp b/src/_ttconv.cpp index 51c2531bed99..a682c26b17b0 100644 --- a/src/_ttconv.cpp +++ b/src/_ttconv.cpp @@ -12,6 +12,7 @@ #include namespace py = pybind11; +using namespace pybind11::literals; /** * An implementation of TTStreamWriter that writes to a Python @@ -75,10 +76,10 @@ PYBIND11_MODULE(_ttconv, m) { "fonts to Postscript Type 3, Postscript Type 42 and " "Pdf Type 3 fonts."; m.def("convert_ttf_to_ps", &convert_ttf_to_ps, - py::arg("filename"), - py::arg("output"), - py::arg("fonttype"), - py::arg("glyph_ids") = py::none(), + "filename"_a, + "output"_a, + "fonttype"_a, + "glyph_ids"_a = py::none(), "Converts the Truetype font into a Type 3 or Type 42 Postscript font, " "optionally subsetting the font to only the desired set of characters.\n" "\n" diff --git a/src/ft2font.cpp b/src/ft2font.cpp index 975041374133..fbc00dc69696 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -195,7 +195,7 @@ static void ft_glyph_warn(FT_ULong charcode) Py_XDECREF(text_helpers); Py_XDECREF(tmp); if (PyErr_Occurred()) { - throw py::exception(); + throw mpl::exception(); } } diff --git a/src/numpy_cpp.h b/src/numpy_cpp.h index 36c763d1584e..e634b9a7271e 100644 --- a/src/numpy_cpp.h +++ b/src/numpy_cpp.h @@ -378,7 +378,7 @@ class array_view : public detail::array_view_accessors array_view(PyObject *arr, bool contiguous = false) : m_arr(NULL), m_data(NULL) { if (!set(arr, contiguous)) { - throw py::exception(); + throw mpl::exception(); } } @@ -413,11 +413,11 @@ class array_view : public detail::array_view_accessors { PyObject *arr = PyArray_SimpleNew(ND, shape, type_num_of::value); if (arr == NULL) { - throw py::exception(); + throw mpl::exception(); } if (!set(arr, true)) { Py_DECREF(arr); - throw py::exception(); + throw mpl::exception(); } Py_DECREF(arr); } diff --git a/src/py_adaptors.h b/src/py_adaptors.h index 7722137dc6e1..1863cd6efbb0 100644 --- a/src/py_adaptors.h +++ b/src/py_adaptors.h @@ -18,12 +18,11 @@ extern "C" { int convert_path(PyObject *obj, void *pathp); } -namespace py -{ +namespace mpl { /************************************************************ - * py::PathIterator acts as a bridge between Numpy and Agg. Given a - * pair of Numpy arrays, vertices and codes, it iterates over + * mpl::PathIterator acts as a bridge between NumPy and Agg. Given a + * pair of NumPy arrays, vertices and codes, it iterates over * those vertices and codes, using the standard Agg vertex source * interface: * @@ -66,14 +65,14 @@ class PathIterator : m_vertices(NULL), m_codes(NULL), m_iterator(0) { if (!set(vertices, codes, should_simplify, simplify_threshold)) - throw py::exception(); + throw mpl::exception(); } inline PathIterator(PyObject *vertices, PyObject *codes) : m_vertices(NULL), m_codes(NULL), m_iterator(0) { if (!set(vertices, codes)) - throw py::exception(); + throw mpl::exception(); } inline PathIterator(const PathIterator &other) @@ -233,11 +232,11 @@ class PathGenerator item = PySequence_GetItem(m_paths, i % m_npaths); if (item == NULL) { - throw py::exception(); + throw mpl::exception(); } if (!convert_path(item, &path)) { Py_DECREF(item); - throw py::exception(); + throw mpl::exception(); } Py_DECREF(item); return path; diff --git a/src/py_converters.cpp b/src/py_converters.cpp index 04382c5f94d0..e700342d5c78 100644 --- a/src/py_converters.cpp +++ b/src/py_converters.cpp @@ -343,7 +343,7 @@ int convert_trans_affine(PyObject *obj, void *transp) int convert_path(PyObject *obj, void *pathp) { - py::PathIterator *path = (py::PathIterator *)pathp; + mpl::PathIterator *path = (mpl::PathIterator *)pathp; PyObject *vertices_obj = NULL; PyObject *codes_obj = NULL; @@ -404,7 +404,7 @@ int convert_path(PyObject *obj, void *pathp) int convert_pathgen(PyObject *obj, void *pathgenp) { - py::PathGenerator *paths = (py::PathGenerator *)pathgenp; + mpl::PathGenerator *paths = (mpl::PathGenerator *)pathgenp; if (!paths->set(obj)) { PyErr_SetString(PyExc_TypeError, "Not an iterable of paths"); return 0; @@ -415,7 +415,7 @@ int convert_pathgen(PyObject *obj, void *pathgenp) int convert_clippath(PyObject *clippath_tuple, void *clippathp) { ClipPath *clippath = (ClipPath *)clippathp; - py::PathIterator path; + mpl::PathIterator path; agg::trans_affine trans; if (clippath_tuple != NULL && clippath_tuple != Py_None) { diff --git a/src/py_converters_11.cpp b/src/py_converters_11.cpp index 982cc9ac6c46..830ee6336fb4 100644 --- a/src/py_converters_11.cpp +++ b/src/py_converters_11.cpp @@ -1,13 +1,13 @@ #include "py_converters_11.h" -void convert_trans_affine(const pybind11::object& transform, agg::trans_affine& affine) +void convert_trans_affine(const py::object& transform, agg::trans_affine& affine) { // If None assume identity transform so leave affine unchanged if (transform.is_none()) { return; } - auto array = pybind11::array_t::ensure(transform); + auto array = py::array_t::ensure(transform); if (!array || array.ndim() != 2 || array.shape(0) != 3 || array.shape(1) != 3) { throw std::invalid_argument("Invalid affine transformation matrix"); } diff --git a/src/py_converters_11.h b/src/py_converters_11.h index 1017b2a3e5c1..9af617d3ee8b 100644 --- a/src/py_converters_11.h +++ b/src/py_converters_11.h @@ -6,8 +6,10 @@ #include #include +namespace py = pybind11; + #include "agg_trans_affine.h" -void convert_trans_affine(const pybind11::object& transform, agg::trans_affine& affine); +void convert_trans_affine(const py::object& transform, agg::trans_affine& affine); #endif diff --git a/src/py_exceptions.h b/src/py_exceptions.h index c4accf263408..7a7e004a4a7a 100644 --- a/src/py_exceptions.h +++ b/src/py_exceptions.h @@ -6,8 +6,8 @@ #include #include -namespace py -{ +namespace mpl { + class exception : public std::exception { public: @@ -23,7 +23,7 @@ class exception : public std::exception { \ a; \ } \ - catch (const py::exception &) \ + catch (const mpl::exception &) \ { \ { \ cleanup; \ diff --git a/src/tri/_tri_wrapper.cpp b/src/tri/_tri_wrapper.cpp index 1b0c3d75555e..d6c4fb10c5d0 100644 --- a/src/tri/_tri_wrapper.cpp +++ b/src/tri/_tri_wrapper.cpp @@ -1,5 +1,7 @@ #include "_tri.h" +using namespace pybind11::literals; + PYBIND11_MODULE(_tri, m) { py::class_(m, "Triangulation") .def(py::init(), - py::arg("x"), - py::arg("y"), - py::arg("triangles"), - py::arg("mask"), - py::arg("edges"), - py::arg("neighbors"), - py::arg("correct_triangle_orientations"), + "x"_a, + "y"_a, + "triangles"_a, + "mask"_a, + "edges"_a, + "neighbors"_a, + "correct_triangle_orientations"_a, "Create a new C++ Triangulation object.\n" "This should not be called directly, use the python class\n" "matplotlib.tri.Triangulation instead.\n") @@ -31,8 +33,8 @@ PYBIND11_MODULE(_tri, m) { py::class_(m, "TriContourGenerator") .def(py::init(), - py::arg("triangulation"), - py::arg("z"), + "triangulation"_a, + "z"_a, "Create a new C++ TriContourGenerator object.\n" "This should not be called directly, use the functions\n" "matplotlib.axes.tricontour and tricontourf instead.\n") @@ -43,7 +45,7 @@ PYBIND11_MODULE(_tri, m) { py::class_(m, "TrapezoidMapTriFinder") .def(py::init(), - py::arg("triangulation"), + "triangulation"_a, "Create a new C++ TrapezoidMapTriFinder object.\n" "This should not be called directly, use the python class\n" "matplotlib.tri.TrapezoidMapTriFinder instead.\n")