Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ostasse/dynamic-graph-python
  • gsaurel/dynamic-graph-python
  • stack-of-tasks/dynamic-graph-python
3 results
Show changes
Commits on Source (68)
Showing
with 249 additions and 178 deletions
# pre-commit run -a (Guilhem Saurel, 2022-07-27)
db4d991c9d727b8454695ce8d88948b948c6b36f
[submodule "cmake"] [submodule "cmake"]
path = cmake path = cmake
url = git://github.com/jrl-umi3218/jrl-cmakemodules.git url = https://github.com/jrl-umi3218/jrl-cmakemodules.git
exclude: tests/test_python-syntax_error.py
ci:
autoupdate_branch: 'devel'
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
args: [--style=Google]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
# Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS # Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem
# Saurel, JRL, CNRS/AIST, LAAS-CNRS
CMAKE_MINIMUM_REQUIRED(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
# Project properties # Project properties
SET(PROJECT_ORG stack-of-tasks) set(PROJECT_ORG stack-of-tasks)
SET(PROJECT_NAME dynamic-graph-python) set(PROJECT_NAME dynamic-graph-python)
SET(PROJECT_DESCRIPTION "Dynamic graph library Python bindings") set(PROJECT_DESCRIPTION "Dynamic graph library Python bindings")
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}") set(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
# Project options # Project options
OPTION(SUFFIX_SO_VERSION "Suffix library name with its version" ON) option(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
# Project configuration # Project configuration
SET(PROJECT_USE_CMAKE_EXPORT TRUE) set(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CUSTOM_HEADER_DIR "dynamic-graph/python") set(CUSTOM_HEADER_DIR "dynamic-graph/python")
SET(CXX_DISABLE_WERROR TRUE) set(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES) set(DOXYGEN_USE_MATHJAX YES)
# JRL-cmakemodule setup # JRL-cmakemodule setup
INCLUDE(cmake/base.cmake) include(cmake/base.cmake)
INCLUDE(cmake/boost.cmake) include(cmake/boost.cmake)
INCLUDE(cmake/python.cmake)
# Project definition # Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX) compute_project_args(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS}) project(${PROJECT_NAME} ${PROJECT_ARGS})
CHECK_MINIMAL_CXX_STANDARD(14 ENFORCE) check_minimal_cxx_standard(14 ENFORCE)
# Project dependencies # Project dependencies
FINDPYTHON() set(PYTHON_COMPONENTS Interpreter Development NumPy)
add_project_dependency(dynamic-graph 4.4.0 REQUIRED)
ADD_PROJECT_DEPENDENCY(dynamic-graph 4.4.0 REQUIRED) add_project_dependency(eigenpy 2.7.10 REQUIRED)
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED) set(PYTHON_EXPORT_DEPENDENCY_MACROS
SEARCH_FOR_BOOST_PYTHON(REQUIRED) "list(APPEND PYTHON_COMPONENTS ${PYTHON_COMPONENTS})\n${PYTHON_EXPORT_DEPENDENCY_MACROS}"
IF(BUILD_TESTING) )
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework) if(BUILD_TESTING)
ENDIF(BUILD_TESTING) find_package(Boost REQUIRED COMPONENTS unit_test_framework)
endif(BUILD_TESTING)
IF(Boost_VERSION GREATER 107299 OR Boost_VERSION_MACRO GREATER 107299)
if(Boost_VERSION GREATER 107299 OR Boost_VERSION_MACRO GREATER 107299)
# Silence a warning about a deprecated use of boost bind by boost >= 1.73 # Silence a warning about a deprecated use of boost bind by boost >= 1.73
# without dropping support for boost < 1.73 # without dropping support for boost < 1.73
ADD_DEFINITIONS(-DBOOST_BIND_GLOBAL_PLACEHOLDERS) add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
ENDIF() endif()
# Main Library # Main Library
SET(${PROJECT_NAME}_HEADERS set(${PROJECT_NAME}_HEADERS
include/${CUSTOM_HEADER_DIR}/api.hh include/${CUSTOM_HEADER_DIR}/api.hh
include/${CUSTOM_HEADER_DIR}/convert-dg-to-py.hh include/${CUSTOM_HEADER_DIR}/convert-dg-to-py.hh
include/${CUSTOM_HEADER_DIR}/dynamic-graph-py.hh include/${CUSTOM_HEADER_DIR}/dynamic-graph-py.hh
include/${CUSTOM_HEADER_DIR}/fwd.hh include/${CUSTOM_HEADER_DIR}/fwd.hh
include/${CUSTOM_HEADER_DIR}/interpreter.hh include/${CUSTOM_HEADER_DIR}/interpreter.hh
include/${CUSTOM_HEADER_DIR}/module.hh include/${CUSTOM_HEADER_DIR}/module.hh
include/${CUSTOM_HEADER_DIR}/python-compat.hh include/${CUSTOM_HEADER_DIR}/python-compat.hh
include/${CUSTOM_HEADER_DIR}/signal.hh include/${CUSTOM_HEADER_DIR}/signal.hh
include/${CUSTOM_HEADER_DIR}/signal-wrapper.hh include/${CUSTOM_HEADER_DIR}/signal-wrapper.hh)
)
set(${PROJECT_NAME}_SOURCES
SET(${PROJECT_NAME}_SOURCES src/interpreter.cc src/dynamic_graph/python-compat.cc
src/interpreter.cc src/dynamic_graph/entity-py.cc src/dynamic_graph/convert-dg-to-py.cc)
src/dynamic_graph/python-compat.cc
src/dynamic_graph/entity-py.cc add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES}
src/dynamic_graph/convert-dg-to-py.cc ${${PROJECT_NAME}_HEADERS})
) target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME} PUBLIC dynamic-graph::dynamic-graph)
ADD_LIBRARY(${PROJECT_NAME} SHARED modernize_target_link_libraries(
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS}) ${PROJECT_NAME}
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${PYTHON_INCLUDE_DIR}) SCOPE
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>) PUBLIC
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${PYTHON_LIBRARY} TARGETS
dynamic-graph::dynamic-graph) Python${PYTHON_VERSION_MAJOR}::Python
TARGET_LINK_BOOST_PYTHON(${PROJECT_NAME} PRIVATE) LIBRARIES
${PYTHON_LIBRARIES}
IF(SUFFIX_SO_VERSION) INCLUDE_DIRS
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION}) ${PYTHON_INCLUDE_DIRS})
ENDIF(SUFFIX_SO_VERSION) target_link_boost_python(${PROJECT_NAME} PUBLIC)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE PYTHON_LIBRARY="${PYTHON_LIBRARY}") if(SUFFIX_SO_VERSION)
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib) endif(SUFFIX_SO_VERSION)
ADD_SUBDIRECTORY(src) target_compile_definitions(${PROJECT_NAME}
IF(BUILD_TESTING) PRIVATE PYTHON_LIBRARY="${PYTHON_LIBRARY}")
ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTING) install(
TARGETS ${PROJECT_NAME}
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME}) EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib)
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(tests)
endif(BUILD_TESTING)
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
[![Building Status](https://travis-ci.org/stack-of-tasks/dynamic-graph-python.svg?branch=master)](https://travis-ci.org/stack-of-tasks/dynamic-graph-python) [![Building Status](https://travis-ci.org/stack-of-tasks/dynamic-graph-python.svg?branch=master)](https://travis-ci.org/stack-of-tasks/dynamic-graph-python)
[![Pipeline status](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/badges/master/pipeline.svg)](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/commits/master) [![Pipeline status](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/badges/master/pipeline.svg)](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/commits/master)
[![Coverage report](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/badges/master/coverage.svg?job=doc-coverage)](http://projects.laas.fr/stack-of-tasks/doc/stack-of-tasks/dynamic-graph-python/master/coverage/) [![Coverage report](https://gitlab.laas.fr/stack-of-tasks/dynamic-graph-python/badges/master/coverage.svg?job=doc-coverage)](http://projects.laas.fr/stack-of-tasks/doc/stack-of-tasks/dynamic-graph-python/master/coverage/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/stack-of-tasks/dynamic-graph-python/master.svg)](https://results.pre-commit.ci/latest/github/stack-of-tasks/dynamic-graph-python)
Python bindings for dynamic-graph. Python bindings for dynamic-graph.
......
Subproject commit a689714c0d0890ffff5649ba25cbaed44dd6e660 Subproject commit 08c2c18b9033c2f0a86b885b589f4fa63a163caf
...@@ -8,4 +8,3 @@ ...@@ -8,4 +8,3 @@
</center> </center>
</body> </body>
</head> </head>
...@@ -4,4 +4,3 @@ ...@@ -4,4 +4,3 @@
<LINK HREF="package.css" REL="stylesheet" TYPE="text/css"> <LINK HREF="package.css" REL="stylesheet" TYPE="text/css">
</HEAD> </HEAD>
<BODY> <BODY>
...@@ -45,8 +45,8 @@ a:link { ...@@ -45,8 +45,8 @@ a:link {
color:#0066CC color:#0066CC
} }
a:hover, a:active { a:hover, a:active {
text-decoration: underline; text-decoration: underline;
color: #3C9A35; color: #3C9A35;
} }
...@@ -57,7 +57,7 @@ a:visited { ...@@ -57,7 +57,7 @@ a:visited {
} }
DIV.memitem DIV.memitem
{ {
spacing: 10px; spacing: 10px;
width:100%; width:100%;
background:#FFFFFF; background:#FFFFFF;
...@@ -70,7 +70,7 @@ DIV.memitem ...@@ -70,7 +70,7 @@ DIV.memitem
} }
DIV.memproto DIV.memproto
{ {
width:100%; width:100%;
background:#F0F0F0; background:#F0F0F0;
font-size:100%; font-size:100%;
...@@ -82,7 +82,7 @@ DIV.memproto ...@@ -82,7 +82,7 @@ DIV.memproto
} }
DIV.memdoc DIV.memdoc
{ {
padding: 10px; padding: 10px;
width:100%; width:100%;
font-size:100%; font-size:100%;
...@@ -189,7 +189,7 @@ DIV.nav ...@@ -189,7 +189,7 @@ DIV.nav
} }
DIV.groupHeader DIV.groupHeader
{ {
padding-top: 30px; padding-top: 30px;
padding-bottom: 20px; padding-bottom: 20px;
background : none; background : none;
...@@ -201,23 +201,23 @@ DIV.groupHeader ...@@ -201,23 +201,23 @@ DIV.groupHeader
color:#0066CC; color:#0066CC;
} }
.directory p .directory p
{ {
margin: 0px; margin: 0px;
white-space: nowrap; white-space: nowrap;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif; font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-size: 10pt; font-size: 10pt;
font-weight: normal; font-weight: normal;
} }
.directory h3 .directory h3
{ {
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif; font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
margin: 0px; margin: 0px;
margin-top: 1em; margin-top: 1em;
padding-bottom: 20px; padding-bottom: 20px;
font-size: 12pt; font-size: 12pt;
font-variant: small-caps; font-variant: small-caps;
text-align: center; text-align: center;
} }
...@@ -227,4 +227,3 @@ DIV.groupHeader ...@@ -227,4 +227,3 @@ DIV.groupHeader
text-decoration: none; text-decoration: none;
color:#0066CC color:#0066CC
} }
...@@ -23,8 +23,8 @@ ABBREVIATE_BRIEF = "The $name class" \ ...@@ -23,8 +23,8 @@ ABBREVIATE_BRIEF = "The $name class" \
ALWAYS_DETAILED_SEC = YES ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO FULL_PATH_NAMES = NO
STRIP_FROM_PATH = STRIP_FROM_PATH =
STRIP_FROM_INC_PATH = STRIP_FROM_INC_PATH =
SHORT_NAMES = NO SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
...@@ -50,7 +50,7 @@ SORT_MEMBER_DOCS = YES ...@@ -50,7 +50,7 @@ SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO SORT_BY_SCOPE_NAME = NO
MAX_INITIALIZER_LINES = 30 MAX_INITIALIZER_LINES = 30
FILE_VERSION_FILTER = FILE_VERSION_FILTER =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -60,18 +60,18 @@ WARN_IF_UNDOCUMENTED = YES ...@@ -60,18 +60,18 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
RECURSIVE = YES RECURSIVE = YES
EXCLUDE = EXCLUDE =
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = * EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
INPUT_FILTER = INPUT_FILTER =
FILTER_PATTERNS = FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to source browsing # configuration options related to source browsing
...@@ -81,7 +81,7 @@ FILTER_SOURCE_FILES = NO ...@@ -81,7 +81,7 @@ FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5 COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX = IGNORE_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -89,8 +89,8 @@ GENERATE_HTML = YES ...@@ -89,8 +89,8 @@ GENERATE_HTML = YES
HTML_FILE_EXTENSION = .html HTML_FILE_EXTENSION = .html
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO GENERATE_HTMLHELP = NO
CHM_FILE = CHM_FILE =
HHC_LOCATION = HHC_LOCATION =
GENERATE_CHI = NO GENERATE_CHI = NO
BINARY_TOC = NO BINARY_TOC = NO
TOC_EXPAND = YES TOC_EXPAND = YES
...@@ -106,8 +106,8 @@ LATEX_CMD_NAME = latex ...@@ -106,8 +106,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = a4wide PAPER_TYPE = a4wide
EXTRA_PACKAGES = EXTRA_PACKAGES =
LATEX_HEADER = LATEX_HEADER =
PDF_HYPERLINKS = NO PDF_HYPERLINKS = NO
USE_PDFLATEX = NO USE_PDFLATEX = NO
LATEX_BATCHMODE = NO LATEX_BATCHMODE = NO
...@@ -118,8 +118,8 @@ LATEX_HIDE_INDICES = NO ...@@ -118,8 +118,8 @@ LATEX_HIDE_INDICES = NO
RTF_OUTPUT = rtf RTF_OUTPUT = rtf
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE = RTF_EXTENSIONS_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -130,8 +130,8 @@ MAN_LINKS = NO ...@@ -130,8 +130,8 @@ MAN_LINKS = NO
# configuration options related to the XML output # configuration options related to the XML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
XML_OUTPUT = xml XML_OUTPUT = xml
XML_SCHEMA = XML_SCHEMA =
XML_DTD = XML_DTD =
XML_PROGRAMLISTING = YES XML_PROGRAMLISTING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output # configuration options for the AutoGen Definitions output
...@@ -142,20 +142,20 @@ GENERATE_AUTOGEN_DEF = NO ...@@ -142,20 +142,20 @@ GENERATE_AUTOGEN_DEF = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PERLMOD_LATEX = NO PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX = PERLMOD_MAKEVAR_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to external references # Configuration::additions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = \ TAGFILES = \
${DYNAMIC_GRAPH_DOCDIR}/html/dynamic-graph.doxytag=${DYNAMIC_GRAPH_DOCDIR}/html ${DYNAMIC_GRAPH_DOCDIR}/html/dynamic-graph.doxytag=${DYNAMIC_GRAPH_DOCDIR}/html
...@@ -164,10 +164,10 @@ ALLEXTERNALS = NO ...@@ -164,10 +164,10 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to the search engine # Configuration::additions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = NO SEARCHENGINE = NO
...@@ -196,7 +196,7 @@ GENERATE_TODOLIST = YES ...@@ -196,7 +196,7 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = NO GENERATE_TESTLIST = NO
GENERATE_BUGLIST = NO GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST= YES GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS = ENABLED_SECTIONS =
SHOW_USED_FILES = NO SHOW_USED_FILES = NO
SHOW_DIRECTORIES = NO SHOW_DIRECTORIES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -206,7 +206,7 @@ SHOW_DIRECTORIES = NO ...@@ -206,7 +206,7 @@ SHOW_DIRECTORIES = NO
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
FILE_PATTERNS = *.hh *.idl FILE_PATTERNS = *.hh *.idl
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS =
INPUT = ${${PROJECT_NAME}_SOURCE_DIR}/include \ INPUT = ${${PROJECT_NAME}_SOURCE_DIR}/include \
${CMAKE_CURRENT_SOURCE_DIR}/additionalDoc ${CMAKE_CURRENT_SOURCE_DIR}/additionalDoc
...@@ -260,13 +260,13 @@ GENERATE_AUTOGEN_DEF = NO ...@@ -260,13 +260,13 @@ GENERATE_AUTOGEN_DEF = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_PERLMOD = NO GENERATE_PERLMOD = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to external references # Configuration::additions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES HIDE_UNDOC_RELATIONS = YES
...@@ -282,8 +282,8 @@ CALL_GRAPH = NO ...@@ -282,8 +282,8 @@ CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =
MAX_DOT_GRAPH_DEPTH = 1000 MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = YES DOT_MULTI_TARGETS = YES
......
// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS. // Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
#include <boost/python.hpp>
#include <dynamic-graph/linear-algebra.h> #include <dynamic-graph/linear-algebra.h>
#include <dynamic-graph/value.h> #include <dynamic-graph/value.h>
#include <boost/python.hpp>
namespace dynamicgraph { namespace dynamicgraph {
namespace python { namespace python {
namespace convert { namespace convert {
command::Value toValue(boost::python::object o, const command::Value::Type& type); command::Value toValue(boost::python::object o,
const command::Value::Type& type);
boost::python::object fromValue(const command::Value& value); boost::python::object fromValue(const command::Value& value);
} // namespace convert } // namespace convert
......
#ifndef DYNAMIC_GRAPH_PY #ifndef DYNAMIC_GRAPH_PY
#define DYNAMIC_GRAPH_PY #define DYNAMIC_GRAPH_PY
#include <iostream>
#include <sstream>
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <dynamic-graph/debug.h> #include <dynamic-graph/debug.h>
#include <dynamic-graph/exception-factory.h> #include <dynamic-graph/exception-factory.h>
#include <dynamic-graph/signal-base.h> #include <dynamic-graph/signal-base.h>
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <iostream>
#include <sstream>
#include "dynamic-graph/python/signal-wrapper.hh" #include "dynamic-graph/python/signal-wrapper.hh"
namespace bp = boost::python; namespace bp = boost::python;
...@@ -33,14 +32,16 @@ inline bp::tuple to_py_tuple(Iterator begin, Iterator end) { ...@@ -33,14 +32,16 @@ inline bp::tuple to_py_tuple(Iterator begin, Iterator end) {
template <typename T> template <typename T>
inline std::vector<T> to_std_vector(const bp::object& iterable) { inline std::vector<T> to_std_vector(const bp::object& iterable) {
return std::vector<T>(bp::stl_input_iterator<T>(iterable), bp::stl_input_iterator<T>()); return std::vector<T>(bp::stl_input_iterator<T>(iterable),
bp::stl_input_iterator<T>());
} }
void exposeSignals(); void exposeSignals();
// Declare functions defined in other source files // Declare functions defined in other source files
namespace signalBase { namespace signalBase {
SignalBase<int>* createSignalWrapper(const char* name, const char* type, bp::object object); SignalBase<int>* createSignalWrapper(const char* name, const char* type,
bp::object object);
} // namespace signalBase } // namespace signalBase
namespace entity { namespace entity {
......
...@@ -15,7 +15,7 @@ namespace dynamicgraph { ...@@ -15,7 +15,7 @@ namespace dynamicgraph {
namespace python { namespace python {
class Interpreter; class Interpreter;
typedef shared_ptr<Interpreter> InterpreterPtr_t; typedef shared_ptr<Interpreter> InterpreterPtr_t;
} // namespace python } // namespace python
} // namespace dynamicgraph } // namespace dynamicgraph
#endif // DYNAMIC_GRAPH_PYTHON_FWD_HH #endif // DYNAMIC_GRAPH_PYTHON_FWD_HH
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
#undef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE #undef _XOPEN_SOURCE
#include <dynamic-graph/python/fwd.hh> #include <dynamic-graph/python/fwd.hh>
#include "dynamic-graph/python/api.hh"
#include "dynamic-graph/python/deprecated.hh"
#include "dynamic-graph/python/python-compat.hh"
#include "dynamic-graph/python/api.hh" #include "dynamic-graph/python/api.hh"
#include "dynamic-graph/python/python-compat.hh"
namespace dynamicgraph { namespace dynamicgraph {
namespace python { namespace python {
...@@ -27,11 +25,13 @@ class DYNAMIC_GRAPH_PYTHON_DLLAPI Interpreter { ...@@ -27,11 +25,13 @@ class DYNAMIC_GRAPH_PYTHON_DLLAPI Interpreter {
/// \brief Method to start python interperter. /// \brief Method to start python interperter.
/// \param command string to execute /// \param command string to execute
/// Method deprecated, you *SHOULD* handle error messages. /// Method deprecated, you *SHOULD* handle error messages.
DYNAMIC_GRAPH_PYTHON_DEPRECATED std::string python(const std::string& command); [[deprecated("you *SHOULD* handle error messages")]] std::string python(
const std::string& command);
/// \brief Method to start python interperter. /// \brief Method to start python interperter.
/// \param command string to execute, result, stdout, stderr strings /// \param command string to execute, result, stdout, stderr strings
void python(const std::string& command, std::string& result, std::string& out, std::string& err); void python(const std::string& command, std::string& result, std::string& out,
std::string& err);
/// \brief Method to exectue a python script. /// \brief Method to exectue a python script.
/// \param filename the filename /// \param filename the filename
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
#include <pinocchio/fwd.hpp> #include <pinocchio/fwd.hpp>
#endif #endif
#include <boost/python.hpp> #include <dynamic-graph/entity.h>
#include <boost/mpl/for_each.hpp> #include <boost/mpl/for_each.hpp>
#include <boost/mpl/vector.hpp> #include <boost/mpl/vector.hpp>
#include <boost/python.hpp>
#include <dynamic-graph/entity.h>
#include <dynamic-graph/python/dynamic-graph-py.hh> #include <dynamic-graph/python/dynamic-graph-py.hh>
namespace dynamicgraph { namespace dynamicgraph {
...@@ -43,14 +43,17 @@ bp::object makeEntity2() { ...@@ -43,14 +43,17 @@ bp::object makeEntity2() {
/// If some commands or signals are added or removed dynamiccally, then /// If some commands or signals are added or removed dynamiccally, then
/// it is better to disable the default behaviour and handle it /// it is better to disable the default behaviour and handle it
/// specifically. /// specifically.
template <typename T, typename bases = boost::python::bases<dynamicgraph::Entity>, template <typename T,
typename bases = boost::python::bases<dynamicgraph::Entity>,
int Options = AddCommands | AddSignals> int Options = AddCommands | AddSignals>
inline auto exposeEntity() { inline auto exposeEntity() {
// std::string hiddenClassName ("_" + T::CLASS_NAME); // std::string hiddenClassName ("_" + T::CLASS_NAME);
std::string hiddenClassName(T::CLASS_NAME); std::string hiddenClassName(T::CLASS_NAME);
namespace bp = boost::python; namespace bp = boost::python;
bp::class_<T, bases, boost::noncopyable> obj(hiddenClassName.c_str(), bp::init<std::string>()); bp::class_<T, bases, boost::noncopyable> obj(hiddenClassName.c_str(),
/* TODO at the moment, I couldn't easily find a way to define a Python constructor bp::init<std::string>());
/* TODO at the moment, I couldn't easily find a way to define a Python
constructor
* that would create the entity via the factory and then populate the * that would create the entity via the factory and then populate the
* python object with its commands. * python object with its commands.
* This is achieved with a factory function of the same name. * This is achieved with a factory function of the same name.
...@@ -64,7 +67,8 @@ inline auto exposeEntity() { ...@@ -64,7 +67,8 @@ inline auto exposeEntity() {
std::cout << "foo" << std::endl; std::cout << "foo" << std::endl;
assert(dynamic_cast<T*>(ent) != NULL); assert(dynamic_cast<T*>(ent) != NULL);
self = bp::object(bp::ptr(static_cast<T*>(ent))); self = bp::object(bp::ptr(static_cast<T*>(ent)));
//dynamicgraph::Entity& unused = bp::extract<dynamicgraph::Entity&>(self); //dynamicgraph::Entity& unused =
bp::extract<dynamicgraph::Entity&>(self);
//entity::addCommands(self); //entity::addCommands(self);
}) })
; ;
......
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
#ifndef DGPY_SIGNAL_WRAPPER #ifndef DGPY_SIGNAL_WRAPPER
#define DGPY_SIGNAL_WRAPPER #define DGPY_SIGNAL_WRAPPER
#include <boost/python.hpp> #include <dynamic-graph/entity.h>
#include <boost/bind.hpp>
#include <dynamic-graph/linear-algebra.h> #include <dynamic-graph/linear-algebra.h>
#include <dynamic-graph/signal.h> #include <dynamic-graph/signal.h>
#include <dynamic-graph/entity.h>
#include <boost/bind.hpp>
#include <boost/python.hpp>
#include "dynamic-graph/python/python-compat.hh" #include "dynamic-graph/python/python-compat.hh"
namespace dynamicgraph { namespace dynamicgraph {
...@@ -34,7 +35,8 @@ class SignalWrapper : public Signal<T, Time> { ...@@ -34,7 +35,8 @@ class SignalWrapper : public Signal<T, Time> {
static bool checkCallable(pyobject c, std::string& error); static bool checkCallable(pyobject c, std::string& error);
SignalWrapper(std::string name, pyobject callable) : parent_t(name), callable(callable) { SignalWrapper(std::string name, pyobject callable)
: parent_t(name), callable(callable) {
typedef boost::function2<T&, T&, Time> function_t; typedef boost::function2<T&, T&, Time> function_t;
function_t f = boost::bind(&SignalWrapper::call, this, _1, _2); function_t f = boost::bind(&SignalWrapper::call, this, _1, _2);
this->setFunction(f); this->setFunction(f);
......
// Copyright 2020, Joseph Mirabel, LAAS-CNRS. // Copyright 2020, Joseph Mirabel, LAAS-CNRS.
#include <sstream>
#include <boost/python.hpp>
#include <dynamic-graph/signal-base.h> #include <dynamic-graph/signal-base.h>
#include <dynamic-graph/signal-ptr.h> #include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h> #include <dynamic-graph/signal-time-dependent.h>
#include <dynamic-graph/signal.h> #include <dynamic-graph/signal.h>
#include <boost/python.hpp>
#include <sstream>
#include "dynamic-graph/python/signal-wrapper.hh" #include "dynamic-graph/python/signal-wrapper.hh"
namespace dynamicgraph { namespace dynamicgraph {
...@@ -19,11 +18,15 @@ auto exposeSignal(const std::string& name) { ...@@ -19,11 +18,15 @@ auto exposeSignal(const std::string& name) {
namespace bp = boost::python; namespace bp = boost::python;
typedef Signal<T, Time> S_t; typedef Signal<T, Time> S_t;
bp::class_<S_t, bp::bases<SignalBase<Time> >, boost::noncopyable> obj(name.c_str(), bp::init<std::string>()); bp::class_<S_t, bp::bases<SignalBase<Time> >, boost::noncopyable> obj(
obj.add_property("value", bp::make_function(&S_t::accessCopy, bp::return_value_policy<bp::copy_const_reference>()), name.c_str(), bp::init<std::string>());
&S_t::setConstant, // TODO check the setter obj.add_property(
"the signal value.\n" "value",
"warning: for Eigen objects, sig.value[0] = 1. may not work)."); bp::make_function(&S_t::accessCopy,
bp::return_value_policy<bp::copy_const_reference>()),
&S_t::setConstant, // TODO check the setter
"the signal value.\n"
"warning: for Eigen objects, sig.value[0] = 1. may not work).");
return obj; return obj;
} }
...@@ -32,7 +35,8 @@ auto exposeSignalWrapper(const std::string& name) { ...@@ -32,7 +35,8 @@ auto exposeSignalWrapper(const std::string& name) {
namespace bp = boost::python; namespace bp = boost::python;
typedef SignalWrapper<T, Time> S_t; typedef SignalWrapper<T, Time> S_t;
bp::class_<S_t, bp::bases<Signal<T, Time> >, boost::noncopyable> obj(name.c_str(), bp::no_init); bp::class_<S_t, bp::bases<Signal<T, Time> >, boost::noncopyable> obj(
name.c_str(), bp::no_init);
return obj; return obj;
} }
...@@ -41,7 +45,8 @@ auto exposeSignalPtr(const std::string& name) { ...@@ -41,7 +45,8 @@ auto exposeSignalPtr(const std::string& name) {
namespace bp = boost::python; namespace bp = boost::python;
typedef SignalPtr<T, Time> S_t; typedef SignalPtr<T, Time> S_t;
bp::class_<S_t, bp::bases<Signal<T, Time> >, boost::noncopyable> obj(name.c_str(), bp::no_init); bp::class_<S_t, bp::bases<Signal<T, Time> >, boost::noncopyable> obj(
name.c_str(), bp::no_init);
return obj; return obj;
} }
...@@ -50,7 +55,8 @@ auto exposeSignalTimeDependent(const std::string& name) { ...@@ -50,7 +55,8 @@ auto exposeSignalTimeDependent(const std::string& name) {
namespace bp = boost::python; namespace bp = boost::python;
typedef SignalTimeDependent<T, Time> S_t; typedef SignalTimeDependent<T, Time> S_t;
bp::class_<S_t, bp::bases<Signal<T, Time> >, boost::noncopyable> obj(name.c_str(), bp::no_init); bp::class_<S_t, bp::bases<Signal<T, Time> >, boost::noncopyable> obj(
name.c_str(), bp::no_init);
return obj; return obj;
} }
......
<?xml version="1.0"?> <?xml version="1.0"?>
<package format="3"> <package format="3">
<name>dynamic-graph-python</name> <name>dynamic-graph-python</name>
<version>4.0.4</version> <version>4.0.11</version>
<description> <description>Dynamic graph library Python bindings</description>
Dynamic graph library Python bindings
</description>
<maintainer email="guilhem.saurel@laas.fr">Guilhem Saurel</maintainer> <maintainer email="guilhem.saurel@laas.fr">Guilhem Saurel</maintainer>
<license>BSD</license>
<url>http://github.com/stack-of-tasks/dynamic-graph-python</url>
<author>Nicolas Mansard</author> <author>Nicolas Mansard</author>
<author>Olivier Stasse</author> <author>Olivier Stasse</author>
<license>BSD</license>
<url type="website">https://github.com/stack-of-tasks/dynamic-graph-python</url>
<build_depend>git</build_depend> <build_depend>git</build_depend>
<build_depend>doxygen</build_depend> <build_depend>doxygen</build_depend>
<doc_depend>doxygen</doc_depend>
<!-- The following tags are recommended by REP-136 --> <!-- The following tag is recommended by REP-136 -->
<exec_depend condition="$ROS_VERSION == 1">catkin</exec_depend> <exec_depend condition="$ROS_VERSION == 1">catkin</exec_depend>
<exec_depend condition="$ROS_VERSION == 2">ament_cmake</exec_depend>
<depend>dynamic-graph</depend> <depend condition="$ROS_PYTHON_VERSION == 2">python</depend>
<depend condition="$ROS_PYTHON_VERSION == 3">python3</depend>
<depend condition="$ROS_PYTHON_VERSION == 2">python-numpy</depend>
<depend condition="$ROS_PYTHON_VERSION == 3">python3-numpy</depend>
<depend>eigen</depend>
<depend>boost</depend> <depend>boost</depend>
<depend>eigenpy</depend> <depend>eigenpy</depend>
<depend>dynamic-graph</depend>
<buildtool_depend>cmake</buildtool_depend> <buildtool_depend>cmake</buildtool_depend>
<export> <export>
<build_type>cmake</build_type> <build_type>cmake</build_type>
</export> </export>
</package> </package>
[tool.black]
exclude = "cmake"
extend-exclude = "tests/test_python-syntax_error.py"
[flake8]
exclude = cmake,tests/test_python-syntax_error.py
max-line-length = 88
ignore = E226, E704, E24, E121, W504, E126, E123, W503, E203