placo 0.6.5__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of placo might be problematic. Click here for more details.
- {placo-0.6.5 → placo-0.7.1}/CMakeLists.txt +11 -5
- {placo-0.6.5 → placo-0.7.1}/Makefile +1 -1
- {placo-0.6.5 → placo-0.7.1}/PKG-INFO +4 -6
- placo-0.7.1/bindings/doxystub/README.md +15 -0
- placo-0.7.1/bindings/doxystub/doxygen_parse.py +301 -0
- placo-0.7.1/bindings/doxystub/stubs.py +368 -0
- placo-0.7.1/bindings/doxystub/stubs.sh +8 -0
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-dynamics.cpp +2 -1
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-footsteps.cpp +4 -3
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-kinematics.cpp +1 -1
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-parameters.cpp +11 -5
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-problem.cpp +1 -1
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-robot-wrapper.cpp +3 -2
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-tools.cpp +10 -5
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-utils.hpp +14 -2
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-walk-pattern-generator.cpp +7 -3
- placo-0.7.1/build_wheel.sh +9 -0
- {placo-0.6.5 → placo-0.7.1}/pyproject.toml +6 -8
- {placo-0.6.5 → placo-0.7.1}/python/placo_utils/visualization.py +7 -6
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/humanoid_parameters.h +3 -1
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/walk_pattern_generator.cpp +87 -34
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/walk_pattern_generator.h +28 -16
- {placo-0.6.5 → placo-0.7.1}/src/placo/model/robot_wrapper.cpp +4 -5
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/polynom.h +6 -0
- placo-0.6.5/doxygen_parse.py +0 -200
- placo-0.6.5/placo.pyi +0 -7897
- placo-0.6.5/stubs.py +0 -267
- {placo-0.6.5 → placo-0.7.1}/.clang-format +0 -0
- {placo-0.6.5 → placo-0.7.1}/.gitattributes +0 -0
- {placo-0.6.5 → placo-0.7.1}/.gitignore +0 -0
- {placo-0.6.5 → placo-0.7.1}/.readthedocs.yaml +0 -0
- {placo-0.6.5 → placo-0.7.1}/Doxyfile +0 -0
- {placo-0.6.5 → placo-0.7.1}/LICENSE +0 -0
- {placo-0.6.5 → placo-0.7.1}/README.md +0 -0
- {placo-0.6.5/bindings → placo-0.7.1/bindings/doxystub}/registry.cpp +0 -0
- {placo-0.6.5/bindings → placo-0.7.1/bindings/doxystub}/registry.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/bindings/expose-eigen.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/bindings/module.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/bindings/module.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/python/.vscode/settings.json +0 -0
- {placo-0.6.5 → placo-0.7.1}/python/Makefile +0 -0
- {placo-0.6.5 → placo-0.7.1}/python/placo_utils/__init__.py +0 -0
- {placo-0.6.5 → placo-0.7.1}/python/placo_utils/tf.py +0 -0
- {placo-0.6.5 → placo-0.7.1}/python/placo_utils/view.py +0 -0
- {placo-0.6.5 → placo-0.7.1}/python/run_tests.sh +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/com_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/com_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/contacts.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/contacts.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/dynamics_solver.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/dynamics_solver.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/frame_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/frame_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/gear_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/gear_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/joints_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/joints_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/orientation_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/orientation_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/position_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/position_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/relative_frame_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/relative_frame_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/relative_orientation_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/relative_orientation_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/relative_position_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/relative_position_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/torque_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/dynamics/torque_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/foot_trajectory.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/foot_trajectory.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/footsteps_planner.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/footsteps_planner.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/footsteps_planner_naive.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/footsteps_planner_naive.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/footsteps_planner_repetitive.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/footsteps_planner_repetitive.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/humanoid_parameters.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/humanoid_robot.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/humanoid_robot.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/kick.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/kick.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/lipm.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/lipm.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/swing_foot.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/swing_foot.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/swing_foot_cubic.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/swing_foot_cubic.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/swing_foot_quintic.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/swing_foot_quintic.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/walk_tasks.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/humanoid/walk_tasks.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/avoid_self_collisions_constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/avoid_self_collisions_constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/axis_align_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/axis_align_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/centroidal_momentum_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/centroidal_momentum_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/com_polygon_constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/com_polygon_constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/com_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/com_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/cone_constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/cone_constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/distance_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/distance_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/frame_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/frame_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/gear_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/gear_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/joint_space_half_spaces_constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/joint_space_half_spaces_constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/joints_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/joints_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/kinematics_solver.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/kinematics_solver.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/kinetic_energy_regularization_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/kinetic_energy_regularization_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/manipulability_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/manipulability_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/orientation_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/orientation_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/position_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/position_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/regularization_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/regularization_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/relative_frame_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/relative_frame_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/relative_orientation_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/relative_orientation_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/relative_position_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/relative_position_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/wheel_task.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/kinematics/wheel_task.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/model/robot_wrapper.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/expression.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/expression.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/integrator.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/integrator.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/polygon_constraint.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/polygon_constraint.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/problem.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/problem.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/problem_polynom.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/problem_polynom.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/qp_error.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/qp_error.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/sparsity.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/sparsity.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/variable.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/problem/variable.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/axises_mask.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/axises_mask.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/cubic_spline.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/cubic_spline.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/cubic_spline_3d.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/cubic_spline_3d.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/directions.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/directions.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/polynom.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/prioritized.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/prioritized.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/segment.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/segment.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/utils.cpp +0 -0
- {placo-0.6.5 → placo-0.7.1}/src/placo/tools/utils.h +0 -0
- {placo-0.6.5 → placo-0.7.1}/tweak_sdist.sh +0 -0
- {placo-0.6.5 → placo-0.7.1}/wks.yml +0 -0
|
@@ -127,7 +127,7 @@ target_link_libraries(libplaco PUBLIC
|
|
|
127
127
|
${PROTOBUF_LIBRARIES}
|
|
128
128
|
${PROTOBUF_LIBRARIES}
|
|
129
129
|
)
|
|
130
|
-
target_compile_definitions(libplaco PUBLIC
|
|
130
|
+
target_compile_definitions(libplaco PUBLIC)
|
|
131
131
|
|
|
132
132
|
if(TARGET rhoban_utils)
|
|
133
133
|
message("Placo: Rhoban utils is present, enabling it")
|
|
@@ -139,6 +139,7 @@ set(CMAKE_SHARED_MODULE_PREFIX "")
|
|
|
139
139
|
|
|
140
140
|
find_package(Python3 REQUIRED)
|
|
141
141
|
find_package(Boost COMPONENTS python REQUIRED)
|
|
142
|
+
find_package(Python REQUIRED COMPONENTS Interpreter)
|
|
142
143
|
|
|
143
144
|
add_library(placo MODULE
|
|
144
145
|
bindings/expose-eigen.cpp
|
|
@@ -151,7 +152,7 @@ add_library(placo MODULE
|
|
|
151
152
|
bindings/expose-walk-pattern-generator.cpp
|
|
152
153
|
bindings/expose-dynamics.cpp
|
|
153
154
|
bindings/module.cpp
|
|
154
|
-
bindings/registry.cpp
|
|
155
|
+
bindings/doxystub/registry.cpp
|
|
155
156
|
)
|
|
156
157
|
set_target_properties(placo PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB})
|
|
157
158
|
|
|
@@ -159,8 +160,13 @@ target_link_libraries(placo ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} libplaco)
|
|
|
159
160
|
target_include_directories(placo PRIVATE ${PYTHON_INCLUDE_DIRS})
|
|
160
161
|
|
|
161
162
|
add_custom_command(TARGET placo POST_BUILD
|
|
162
|
-
COMMAND
|
|
163
|
-
|
|
163
|
+
COMMAND
|
|
164
|
+
"${Python_EXECUTABLE}"
|
|
165
|
+
${CMAKE_CURRENT_SOURCE_DIR}/bindings/doxystub/stubs.py
|
|
166
|
+
placo
|
|
167
|
+
"${CMAKE_CURRENT_SOURCE_DIR}"
|
|
168
|
+
"${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo.pyi"
|
|
169
|
+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}"
|
|
164
170
|
COMMENT "Generating stubs..."
|
|
165
171
|
)
|
|
166
172
|
|
|
@@ -175,4 +181,4 @@ set_target_properties(libplaco PROPERTIES INSTALL_RPATH "\$ORIGIN")
|
|
|
175
181
|
install(TARGETS libplaco DESTINATION lib)
|
|
176
182
|
install(TARGETS placo DESTINATION ${PYTHON_SITELIB})
|
|
177
183
|
install(FILES ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo.pyi DESTINATION ${PYTHON_SITELIB})
|
|
178
|
-
install(DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo_utils DESTINATION ${PYTHON_SITELIB})
|
|
184
|
+
install(DIRECTORY ${CMAKE_BINARY_DIR}/${PYTHON_SITELIB}/placo_utils DESTINATION ${PYTHON_SITELIB})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: placo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: PlaCo: Rhoban Planning and Control
|
|
5
|
-
Requires-Python: >= 3.
|
|
5
|
+
Requires-Python: >= 3.9
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Author-email: Rhoban team <team@rhoban.com>
|
|
8
8
|
Project-URL: Changelog, https://github.com/rhoban/placo/blob/main/CHANGELOG.md
|
|
@@ -10,14 +10,12 @@ Home-page: https://placo.readthedocs.io/en/latest/
|
|
|
10
10
|
Project-URL: Repository, https://github.com/rhoban/placo.git
|
|
11
11
|
Requires-Dist: cmeel
|
|
12
12
|
Requires-Dist: eiquadprog >= 1.2.6, < 2
|
|
13
|
-
Requires-Dist: pin >=
|
|
13
|
+
Requires-Dist: pin >= 3
|
|
14
14
|
Requires-Dist: rhoban-cmeel-jsoncpp
|
|
15
15
|
Requires-Dist: meshcat
|
|
16
|
-
Requires-Dist: numpy<2
|
|
17
16
|
Requires-Dist: ischedule
|
|
18
17
|
Provides-Extra: build
|
|
19
|
-
Requires-Dist: pin[build] >=
|
|
20
|
-
Requires-Dist: cmeel-urdfdom[build] ; extra == "build"
|
|
18
|
+
Requires-Dist: pin[build] >= 3 ; extra == "build"
|
|
21
19
|
Description-Content-Type: text/markdown
|
|
22
20
|
|
|
23
21
|
<img width="400" src="https://placo.readthedocs.io/en/latest/_static/placo.png" />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generate Doxygen stubs
|
|
2
|
+
|
|
3
|
+
This code allow to generate a `module.pyi` file containing useful auto-completion stubs, based on Doxygen and introspection.
|
|
4
|
+
|
|
5
|
+
## Step1: configure your project
|
|
6
|
+
|
|
7
|
+
In `config.py`, set the name of the module and the path to the source directory (where the `Doxyfile` is)
|
|
8
|
+
|
|
9
|
+
## Step2: expose through registry
|
|
10
|
+
|
|
11
|
+
Include `registry.h` in your Python bindings, and use `class__` instead of `class_`, so that the registered classes will be wrapped in the registry
|
|
12
|
+
|
|
13
|
+
## Step3: call `stubs.py` after compilation
|
|
14
|
+
|
|
15
|
+
Execute the `stubs.py` script after compilation, it will output the `pyi` file.
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import glob
|
|
2
|
+
import re
|
|
3
|
+
from typing import Union
|
|
4
|
+
import xml.etree.ElementTree as ET
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def element_to_string(element: ET.Element) -> str:
|
|
8
|
+
"""
|
|
9
|
+
Retrieve the contents of a given node
|
|
10
|
+
"""
|
|
11
|
+
s = element.text or ""
|
|
12
|
+
for sub_element in element:
|
|
13
|
+
s += ET.tostring(sub_element).decode("utf-8")
|
|
14
|
+
s += element.tail
|
|
15
|
+
return re.sub("<[^<]+?>", "", s)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def parse_type(node: ET.Element):
|
|
19
|
+
"""
|
|
20
|
+
Retrieve the type of the object present in the given node
|
|
21
|
+
"""
|
|
22
|
+
type_node = node.find("type")
|
|
23
|
+
|
|
24
|
+
if type_node.find("ref") is not None:
|
|
25
|
+
if type_node.text and "vector" in type_node.text:
|
|
26
|
+
return ["std::vector", type_node.find("ref").attrib["refid"]]
|
|
27
|
+
else:
|
|
28
|
+
return type_node.find("ref").attrib["refid"]
|
|
29
|
+
else:
|
|
30
|
+
return type_node.text
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class DoxygenElement:
|
|
34
|
+
def __init__(self, id: str, name: str):
|
|
35
|
+
self.id = id
|
|
36
|
+
self.name: str = name
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class DoxygenTypedef(DoxygenElement):
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class DoxygenMember(DoxygenElement):
|
|
44
|
+
def __init__(self, id: str, name: str):
|
|
45
|
+
super().__init__(id, name)
|
|
46
|
+
self.static: bool = False
|
|
47
|
+
self.type: str | None = None
|
|
48
|
+
self.brief: str = ""
|
|
49
|
+
|
|
50
|
+
def parse(self, node: ET.Element):
|
|
51
|
+
self.static = node.attrib["static"] == "yes"
|
|
52
|
+
|
|
53
|
+
self.type = parse_type(node)
|
|
54
|
+
|
|
55
|
+
# Brief description
|
|
56
|
+
self.brief = node.find("briefdescription/para")
|
|
57
|
+
if self.brief is not None:
|
|
58
|
+
self.brief = element_to_string(self.brief)
|
|
59
|
+
|
|
60
|
+
# Verbatim
|
|
61
|
+
verbatim = node.find("detaileddescription/para/verbatim")
|
|
62
|
+
if verbatim is not None:
|
|
63
|
+
self.brief += "\n" + verbatim.text
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class DoxygenVariable(DoxygenMember):
|
|
67
|
+
pass
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class DoxygenParameter:
|
|
71
|
+
def __init__(self):
|
|
72
|
+
self.type = None
|
|
73
|
+
self.name = None
|
|
74
|
+
self.default_value = None
|
|
75
|
+
self.description = None
|
|
76
|
+
|
|
77
|
+
def parse(self, node: ET.Element):
|
|
78
|
+
self.type = parse_type(node)
|
|
79
|
+
|
|
80
|
+
if node.find("declname") is not None:
|
|
81
|
+
self.name = node.find("declname").text
|
|
82
|
+
if node.find("defname") is not None:
|
|
83
|
+
self.name = node.find("defname").text
|
|
84
|
+
|
|
85
|
+
self.default_value = (
|
|
86
|
+
node.find("defval").text if node.find("defval") is not None else None
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class DoxygenFunction(DoxygenMember):
|
|
91
|
+
def __init__(self, id: str, name: str, class_member: bool = False):
|
|
92
|
+
super().__init__(id, name)
|
|
93
|
+
self.params: list[DoxygenParameter] = []
|
|
94
|
+
self.returns_description = None
|
|
95
|
+
self.class_member = class_member
|
|
96
|
+
|
|
97
|
+
def parse(self, node: ET.Element):
|
|
98
|
+
super().parse(node)
|
|
99
|
+
|
|
100
|
+
# Searching for method parameters
|
|
101
|
+
for param in node.findall("param"):
|
|
102
|
+
parameter = DoxygenParameter()
|
|
103
|
+
parameter.parse(param)
|
|
104
|
+
self.params.append(parameter)
|
|
105
|
+
|
|
106
|
+
# Searching for detailed description to retrieve parameter descriptions
|
|
107
|
+
for entry in node.findall(
|
|
108
|
+
"detaileddescription/para/parameterlist/parameteritem"
|
|
109
|
+
):
|
|
110
|
+
param_name = entry.find("parameternamelist/parametername").text
|
|
111
|
+
param_desc = element_to_string(entry.find("parameterdescription/para"))
|
|
112
|
+
|
|
113
|
+
for param in self.params:
|
|
114
|
+
if param.name == param_name:
|
|
115
|
+
param.description = param_desc
|
|
116
|
+
|
|
117
|
+
# Description of method returns
|
|
118
|
+
return_desc = node.find("detaileddescription/para/simplesect[@kind='return']")
|
|
119
|
+
if return_desc:
|
|
120
|
+
self.returns_description = return_desc.find("para")
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class DoxygenCompound(DoxygenElement):
|
|
124
|
+
def __init__(self, id: str, name: str):
|
|
125
|
+
super().__init__(id, name)
|
|
126
|
+
self.brief: str | None = None
|
|
127
|
+
self.members: dict[str, DoxygenMember] = {}
|
|
128
|
+
self.types: dict[str, str] = {}
|
|
129
|
+
self.is_class: bool = False
|
|
130
|
+
|
|
131
|
+
def parse(self, node: ET.Element):
|
|
132
|
+
if node.find("briefdescription/para"):
|
|
133
|
+
self.brief = element_to_string(node.find("briefdescription/para"))
|
|
134
|
+
|
|
135
|
+
# Searching for member definitions
|
|
136
|
+
for member_node in node.findall("sectiondef/memberdef"):
|
|
137
|
+
# If @pyignore is added to the description, this member is skipped
|
|
138
|
+
ignore = False
|
|
139
|
+
sects = member_node.findall("detaileddescription/para/xrefsect")
|
|
140
|
+
if sects:
|
|
141
|
+
for sect in sects:
|
|
142
|
+
if "pyignore" in sect.attrib["id"]:
|
|
143
|
+
ignore = True
|
|
144
|
+
if ignore:
|
|
145
|
+
continue
|
|
146
|
+
|
|
147
|
+
kind = member_node.attrib["kind"]
|
|
148
|
+
id = member_node.attrib["id"]
|
|
149
|
+
|
|
150
|
+
member = None
|
|
151
|
+
if kind == "function":
|
|
152
|
+
member = DoxygenFunction(
|
|
153
|
+
id, member_node.find("name").text, self.is_class
|
|
154
|
+
)
|
|
155
|
+
member.parse(member_node)
|
|
156
|
+
elif kind == "variable":
|
|
157
|
+
member = DoxygenVariable(id, member_node.find("name").text)
|
|
158
|
+
member.parse(member_node)
|
|
159
|
+
elif kind == "typedef":
|
|
160
|
+
self.types[id] = DoxygenTypedef(id, parse_type(member_node))
|
|
161
|
+
elif kind == "enum":
|
|
162
|
+
self.types[id] = DoxygenTypedef(
|
|
163
|
+
id, self.name + "::" + member_node.find("name").text
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
if member is not None:
|
|
167
|
+
self.members[id] = member
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class DoxygenClass(DoxygenCompound):
|
|
171
|
+
def __init__(self, id: str, name: str):
|
|
172
|
+
super().__init__(id, name)
|
|
173
|
+
self.is_class: bool = True
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class DoxygenNamespace(DoxygenCompound):
|
|
177
|
+
def __init__(self, id: str, name: str):
|
|
178
|
+
super().__init__(id, name)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class Doxygen:
|
|
182
|
+
def __init__(self):
|
|
183
|
+
self.compounds: dict[str, DoxygenCompound] = {}
|
|
184
|
+
self.elements: dict[str, DoxygenElement] = {}
|
|
185
|
+
|
|
186
|
+
def parse_directory(self, directory: str):
|
|
187
|
+
doxygen_xml_files = glob.glob(f"{directory}/xml/*.xml")
|
|
188
|
+
|
|
189
|
+
# Parsing all files
|
|
190
|
+
for xml_file in doxygen_xml_files:
|
|
191
|
+
self.parse_xml(xml_file)
|
|
192
|
+
|
|
193
|
+
# Collecting all elements (compounds, members and typedefs)
|
|
194
|
+
self.elements = self.compounds.copy()
|
|
195
|
+
for compound in self.compounds.values():
|
|
196
|
+
for element in list(compound.members.values()) + list(
|
|
197
|
+
compound.types.values()
|
|
198
|
+
):
|
|
199
|
+
self.elements[element.id] = element
|
|
200
|
+
|
|
201
|
+
# Resolving member and parameter types
|
|
202
|
+
for compound in self.compounds.values():
|
|
203
|
+
for member in compound.members.values():
|
|
204
|
+
member.type = self.resolve_type(member.type)
|
|
205
|
+
|
|
206
|
+
if isinstance(member, DoxygenFunction):
|
|
207
|
+
function: DoxygenFunction = member
|
|
208
|
+
for param in member.params:
|
|
209
|
+
param.type = self.resolve_type(param.type)
|
|
210
|
+
|
|
211
|
+
def resolve_type(self, id: Union[list, str]):
|
|
212
|
+
if type(id) == list:
|
|
213
|
+
tpl = self.resolve_type(id[0])
|
|
214
|
+
subtypes = [self.resolve_type(subid) for subid in id[1:]]
|
|
215
|
+
args = ",".join(subtypes)
|
|
216
|
+
return f"{tpl}<{args}>"
|
|
217
|
+
elif id in self.elements:
|
|
218
|
+
return self.elements[id].name
|
|
219
|
+
else:
|
|
220
|
+
return id
|
|
221
|
+
|
|
222
|
+
def parse_xml(self, filename: str):
|
|
223
|
+
with open(filename, "r") as f:
|
|
224
|
+
xml_content = f.read()
|
|
225
|
+
xml_content = ET.fromstring(xml_content)
|
|
226
|
+
|
|
227
|
+
# Searching for compounddef nodes (classs & struct)
|
|
228
|
+
for compounddef_node in xml_content.findall("compounddef"):
|
|
229
|
+
self.parse_compound(compounddef_node)
|
|
230
|
+
|
|
231
|
+
def parse_compound(self, compounddef_node: ET.Element):
|
|
232
|
+
name = compounddef_node.find("compoundname").text
|
|
233
|
+
compound_kind = compounddef_node.attrib["kind"]
|
|
234
|
+
id = compounddef_node.attrib["id"]
|
|
235
|
+
|
|
236
|
+
if compound_kind == "class" or compound_kind == "struct":
|
|
237
|
+
compound = DoxygenClass(id, name)
|
|
238
|
+
elif compound_kind == "namespace":
|
|
239
|
+
compound = DoxygenNamespace(id, name)
|
|
240
|
+
else:
|
|
241
|
+
return
|
|
242
|
+
|
|
243
|
+
compound.parse(compounddef_node)
|
|
244
|
+
self.compounds[id] = compound
|
|
245
|
+
|
|
246
|
+
def get_class(self, class_name: str) -> DoxygenClass | None:
|
|
247
|
+
for compound in self.compounds.values():
|
|
248
|
+
if compound.name == class_name:
|
|
249
|
+
return compound
|
|
250
|
+
|
|
251
|
+
return None
|
|
252
|
+
|
|
253
|
+
def get_class_member(
|
|
254
|
+
self, class_name: str, member_name: str
|
|
255
|
+
) -> DoxygenMember | None:
|
|
256
|
+
class_ = self.get_class(class_name)
|
|
257
|
+
|
|
258
|
+
if class_ is not None:
|
|
259
|
+
for member in class_.members.values():
|
|
260
|
+
if member.name == member_name:
|
|
261
|
+
return member
|
|
262
|
+
|
|
263
|
+
return None
|
|
264
|
+
|
|
265
|
+
def get_function(self, function_name: str) -> DoxygenFunction | None:
|
|
266
|
+
for compound in self.compounds.values():
|
|
267
|
+
if isinstance(compound, DoxygenNamespace):
|
|
268
|
+
for member in compound.members.values():
|
|
269
|
+
if (
|
|
270
|
+
isinstance(member, DoxygenFunction)
|
|
271
|
+
and member.name == function_name
|
|
272
|
+
):
|
|
273
|
+
return member
|
|
274
|
+
|
|
275
|
+
return None
|
|
276
|
+
|
|
277
|
+
def get_class_function(
|
|
278
|
+
self, class_name: str, function_name: str
|
|
279
|
+
) -> DoxygenFunction | None:
|
|
280
|
+
member = self.get_class_member(class_name, function_name)
|
|
281
|
+
|
|
282
|
+
if isinstance(member, DoxygenFunction):
|
|
283
|
+
return member
|
|
284
|
+
|
|
285
|
+
return None
|
|
286
|
+
|
|
287
|
+
def get_class_variable(
|
|
288
|
+
self, class_name: str, function_name: str
|
|
289
|
+
) -> DoxygenVariable | None:
|
|
290
|
+
member = self.get_class_member(class_name, function_name)
|
|
291
|
+
|
|
292
|
+
if isinstance(member, DoxygenVariable):
|
|
293
|
+
return member
|
|
294
|
+
|
|
295
|
+
return None
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
if __name__ == "__main__":
|
|
299
|
+
# parse_directory(".")
|
|
300
|
+
doxygen = Doxygen()
|
|
301
|
+
doxygen.parse_directory(".")
|