Skip to content

Commit 8fd9f01

Browse files
committed
Improved arguments with enum default values using py::arg_v.
1 parent 83d6811 commit 8fd9f01

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

cpp/pybind/t/geometry/image.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ void pybind_image_definitions(py::module &m) {
181181
"Upsample if sampling rate > 1. Aspect ratio is always "
182182
"kept.",
183183
"sampling_rate"_a = 0.5,
184-
"interp_type"_a = Image::InterpType::Nearest)
184+
py::arg_v("interp_type", Image::InterpType::Nearest,
185+
"open3d.t.geometry.InterpType.Nearest"))
185186
.def("pyrdown", &Image::PyrDown,
186187
"Return a new downsampled image with pyramid downsampling "
187188
"formed by a chained Gaussian filter (kernel_size = 5, sigma"

cpp/pybind/t/pipelines/registration/robust_kernel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ void pybind_robust_kernel_definitions(py::module& m) {
115115
return new RobustKernel(type, scaling_parameter,
116116
shape_parameter);
117117
}),
118-
"type"_a = RobustKernelMethod::L2Loss,
118+
py::arg_v("type", RobustKernelMethod::L2Loss,
119+
"open3d.t.pipelines.registration.RobustKernelMethod."
120+
"L2Loss"),
119121
"scaling_parameter"_a = 1.0, "shape_parameter"_a = 1.0)
120122
.def_readwrite("type", &RobustKernel::type_, "Loss type.")
121123
.def_readwrite("scaling_parameter",

cpp/pybind/visualization/gui/gui.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ void pybind_gui_definitions(py::module &m) {
537537
fd.attr("MONOSPACE") = FontDescription::MONOSPACE;
538538
fd.def(py::init<const char *, FontStyle, int>(),
539539
"typeface"_a = FontDescription::SANS_SERIF,
540-
"style"_a = FontStyle::NORMAL, "point_size"_a = 0,
540+
py::arg_v("style", FontStyle::NORMAL, "open3d.gui.FontStyle.NORMAL"),
541+
"point_size"_a = 0,
541542
"Creates a FontDescription. 'typeface' is a path to a "
542543
"TrueType (.ttf), TrueType Collection (.ttc), or "
543544
"OpenType (.otf) file, or it is the name of the font, "

cpp/pybind/visualization/rendering/rendering.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ void pybind_rendering_definitions(py::module &m) {
516516
"Typical values are 2, 4 or 8. The maximum possible value "
517517
"depends on the underlying GPU and OpenGL driver.")
518518
.def("set_shadowing", &View::SetShadowing, "enabled"_a,
519-
"type"_a = View::ShadowType::kPCF,
519+
py::arg_v(
520+
"type", View::ShadowType::kPCF,
521+
"open3d.visualization.rendering.View.ShadowType.PCF"),
520522
"True to enable, false to enable all shadow mapping when "
521523
"rendering this View. When enabling shadow mapping you may "
522524
"also specify one of two shadow mapping algorithms: PCF "

0 commit comments

Comments
 (0)