Added non_linear_effect to python interface #261
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run the Eigen tests | |
| on: [pull_request] | |
| env: | |
| BUILD_FOLDER: build | |
| EXAMPLES_FOLDER: examples | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| include: | |
| - os: ubuntu-latest | |
| label: linux-64 | |
| prefix: /usr/share/miniconda3/envs/biorbd | |
| use_matlab: ON | |
| - os: macos-latest | |
| label: osx-arm64 | |
| prefix: /Users/runner/miniconda3/envs/biorbd | |
| use_matlab: ON | |
| - os: windows-latest | |
| label: win-64 | |
| prefix: C:\Miniconda3\envs\biorbd | |
| use_matlab: ON | |
| name: ${{ matrix.label }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get number of CPU cores | |
| uses: SimenB/github-actions-cpu-cores@v1 | |
| id: cpu-cores | |
| - name: Setup environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: biorbd | |
| - name: Install dependencies | |
| run: | | |
| conda install -cconda-forge rbdl tinyxml2 ipopt | |
| conda install -cconda-forge "swig<4.4.0" python numpy scipy pytest | |
| conda list | |
| - name: Setup Linux dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install libstdc++-11-dev | |
| if: matrix.label == 'linux-64' | |
| - name: Install MATLAB on WINDOWS LINUX and MACOS | |
| uses: matlab-actions/setup-matlab@v2 | |
| with: | |
| cache: true | |
| - name: Build biorbd UNIX | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| CONDA_ENV_PATH=$CONDA/envs/biorbd | |
| mkdir -p $BIORBD_FOLDER/$BUILD_FOLDER | |
| cd $BIORBD_FOLDER/$BUILD_FOLDER | |
| cmake .. \ | |
| -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH \ | |
| -DMATH_LIBRARY_BACKEND="Eigen3" \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DBUILD_TESTS=ON \ | |
| -DMODULE_ACTUATORS=ON \ | |
| -DMODULE_KALMAN=ON \ | |
| -DMODULE_PASSIVE_TORQUES=ON \ | |
| -DMODULE_MUSCLES=ON \ | |
| -DBUILD_EXAMPLE=ON \ | |
| -DBINDER_C=ON \ | |
| -DBINDER_PYTHON3=ON \ | |
| -DBINDER_MATLAB=${{ matrix.use_matlab }} \ | |
| -DMatlab_biorbd_eigen_INSTALL_DIR=$HOME | |
| make install -j${{ steps.cpu-cores.outputs.count }} | |
| cd $BIORBD_FOLDER | |
| if: matrix.label != 'win-64' | |
| - name: Run tests UNIX | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| cd $BIORBD_FOLDER/$BUILD_FOLDER/test | |
| ./biorbd_eigen_tests | |
| cd $BIORBD_FOLDER | |
| if: matrix.label != 'win-64' | |
| - name: Run c binder tests UNIX | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| cd $BIORBD_FOLDER/$BUILD_FOLDER/test/binding/c | |
| ./biorbd_eigen_tests_binding_c | |
| cd $BIORBD_FOLDER | |
| if: matrix.label != 'win-64' | |
| - name: Test installed version on UNIX | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| CONDA_ENV_PATH=$CONDA/envs/biorbd | |
| cd $BIORBD_FOLDER/$EXAMPLES_FOLDER/cpp_eigen_installed | |
| mkdir -p $BUILD_FOLDER | |
| cd $BUILD_FOLDER | |
| cmake .. \ | |
| -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| make -j${{ steps.cpu-cores.outputs.count }} | |
| ./forwardDynamicsExample | |
| cd $BIORBD_FOLDER | |
| if: matrix.label != 'win-64' | |
| - name: Build biorbd WINDOWS | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| CONDA_ENV_PATH=$CONDA/envs/biorbd | |
| mkdir -p $BUILD_FOLDER | |
| cd $BUILD_FOLDER | |
| cmake .. \ | |
| -G"Visual Studio 17 2022" \ | |
| -Ax64 \ | |
| -DMATH_LIBRARY_BACKEND="Eigen3" \ | |
| -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH \ | |
| -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON \ | |
| -DMODULE_ACTUATORS=ON -DMODULE_KALMAN=ON \ | |
| -DMODULE_MUSCLES=ON -DBUILD_EXAMPLE=ON \ | |
| -DBINDER_C=ON -DBINDER_PYTHON3=ON \ | |
| -DBINDER_MATLAB=${{ matrix.use_matlab }} \ | |
| -DMatlab_biorbd_eigen_INSTALL_DIR=$HOME | |
| cmake --build . --config Release --target install -j${{ steps.cpu-cores.outputs.count }} | |
| cd $BIORBD_FOLDER | |
| if: matrix.label == 'win-64' | |
| - name: Run tests WINDOWS | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| cd $BIORBD_FOLDER/$BUILD_FOLDER/test | |
| cp Release/biorbd_eigen_tests.exe . | |
| ./biorbd_eigen_tests.exe | |
| cd $BIORBD_FOLDER | |
| if: matrix.label == 'win-64' | |
| - name: Run c binder tests WINDOWS | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| cd $BIORBD_FOLDER/$BUILD_FOLDER/test/binding/c | |
| cp Release/biorbd_eigen_tests_binding_c.exe . | |
| ./biorbd_eigen_tests_binding_c.exe | |
| cd $BIORBD_FOLDER | |
| if: matrix.label == 'win-64' | |
| - name: Test installed version on WINDOWS | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| CONDA_ENV_PATH=$CONDA/envs/biorbd | |
| cd $BIORBD_FOLDER/$EXAMPLES_FOLDER/cpp_eigen_installed | |
| mkdir -p $BUILD_FOLDER | |
| cd $BUILD_FOLDER | |
| cmake .. \ | |
| -G"Visual Studio 17 2022" \ | |
| -Ax64 \ | |
| -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --config Release -j${{ steps.cpu-cores.outputs.count }} | |
| cp Release/forwardDynamicsExample.exe . | |
| ./forwardDynamicsExample.exe | |
| cd $BIORBD_FOLDER | |
| if: matrix.label == 'win-64' | |
| - name: Run python binder tests | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| cd $BIORBD_FOLDER/$BUILD_FOLDER/test/binding/python3 | |
| export CI_MAIN_EXAMPLES_FOLDER=$BIORBD_FOLDER/$EXAMPLES_FOLDER | |
| pytest . | |
| cd $BIORBD_FOLDER | |
| - name: Test installed version of python | |
| run: | | |
| BIORBD_FOLDER=`pwd` | |
| cd | |
| python -c "import biorbd" | |
| cd $BIORBD_FOLDER | |
| - name: Run MATLAB binder tests | |
| run: | | |
| # We cannot run the tests as we do not have a license. | |
| # At least we know it compiles |