stulp / dmpbbo

Python/C++ library for Dynamical Movement Primitives and Black-Box Optimization
GNU Lesser General Public License v2.1
227 stars 89 forks source link

Refactoring Python/C++ redundancy #60

Closed stulp closed 2 years ago

stulp commented 2 years ago

Rationale for removing bbo C++ implementation

There is obvious code redunancy due to the parallel Python and C++ implementations. This is because there are two different purposes.

The modules bbo and dmp_bbo need not be real-time, and therefore the C++ implementation is not really necessary.

Planned refactoring steps

  1. Port functionality from src/bbo to python/bbo (and dmp_bbo also)
  2. Add docstrings in Python from C++ code
  3. Apply consistent formatting in Python with black
  4. Remove src/dmp_bbo, src/bbo

Further steps along the way:

stulp commented 2 years ago

Further idea: anything that is not real-time need not be in C++ (e.g. training)

Use case:

All train() functions could then be removed from the C++ version (i.e. also no more meta-paramers necessary in C++)

In C++, only the UnifiedModel would be necessary (or perhaps two, i.e. weighted basis functions or weighted line segments)

stulp commented 2 years ago

The redundancy has been resolved in v2 of dmpbbo: https://github.com/stulp/dmpbbo/tree/v2