Skip to content

Commit

Permalink
python: Apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Sep 25, 2024
1 parent 55169da commit ed3439c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions include/pinocchio/bindings/python/spatial/force.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ namespace pinocchio
"__array__", bp::make_function(
(typename Force::ToVectorReturnType(Force::*)()) & Force::toVector,
bp::return_internal_reference<>()))
.def("__array__", &__array__, (bp::arg("self"), bp::arg("dtype")=bp::object(), bp::arg("copy")=bp::object()), bp::return_internal_reference<>())
.def(
"__array__", &__array__,
(bp::arg("self"), bp::arg("dtype") = bp::object(), bp::arg("copy") = bp::object()),
bp::return_internal_reference<>())
#ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION
.def_pickle(Pickle())
#endif
Expand Down Expand Up @@ -197,7 +200,8 @@ namespace pinocchio
}

private:
static typename Force::ToVectorConstReturnType __array__(const Force & self, bp::object, bp::object)
static typename Force::ToVectorConstReturnType
__array__(const Force & self, bp::object, bp::object)
{
return self.toVector();
}
Expand Down
4 changes: 3 additions & 1 deletion include/pinocchio/bindings/python/spatial/inertia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ namespace pinocchio
.staticmethod("FromCapsule")

.def("__array__", (Matrix6(Inertia::*)() const) & Inertia::matrix)
.def("__array__", &__array__, (bp::arg("self"), bp::arg("dtype")=bp::object(), bp::arg("copy")=bp::object()))
.def(
"__array__", &__array__,
(bp::arg("self"), bp::arg("dtype") = bp::object(), bp::arg("copy") = bp::object()))
#ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION
.def_pickle(Pickle())
#endif
Expand Down
8 changes: 6 additions & 2 deletions include/pinocchio/bindings/python/spatial/motion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ namespace pinocchio
"__array__", bp::make_function(
(typename Motion::ToVectorReturnType(Motion::*)()) & Motion::toVector,
bp::return_internal_reference<>()))
.def("__array__", &__array__, (bp::arg("self"), bp::arg("dtype")=bp::object(), bp::arg("copy")=bp::object()), bp::return_internal_reference<>())
.def(
"__array__", &__array__,
(bp::arg("self"), bp::arg("dtype") = bp::object(), bp::arg("copy") = bp::object()),
bp::return_internal_reference<>())
#ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION
.def_pickle(Pickle())
#endif
Expand Down Expand Up @@ -220,7 +223,8 @@ namespace pinocchio
}

private:
static typename Motion::ToVectorConstReturnType __array__(const Motion & self, bp::object, bp::object)
static typename Motion::ToVectorConstReturnType
__array__(const Motion & self, bp::object, bp::object)
{
return self.toVector();
}
Expand Down
4 changes: 3 additions & 1 deletion include/pinocchio/bindings/python/spatial/se3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ namespace pinocchio
.staticmethod("Interpolate")

.def("__array__", &SE3::toHomogeneousMatrix)
.def("__array__", &__array__, (bp::arg("self"), bp::arg("dtype")=bp::object(), bp::arg("copy")=bp::object()))
.def(
"__array__", &__array__,
(bp::arg("self"), bp::arg("dtype") = bp::object(), bp::arg("copy") = bp::object()))

#ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION
.def_pickle(Pickle())
Expand Down

0 comments on commit ed3439c

Please sign in to comment.