Skip to content

Commit a9b8fa1

Browse files
Merge pull request #10 from GiorgioMedico:dev
Summary InterpolatePy v3.0.0 — Full C++ Port with Python Bindings This major release adds a complete C++ implementation (interpolatecpp) of all 22+ algorithms alongside the existing pure-Python library, with a transparent backend system that lets users switch between implementations. Highlights - Complete C++ library (cpp/) — headers, sources, CMake build system, and GoogleTest suite covering splines, B-splines, motion profiles, quaternion interpolation, and path planning - Python bindings via pybind11 (cpp/bindings/) exposing the C++ library as interpolatecpp - Backend adapter layer (interpolatepy/_adapters/) — seamless bridge between C++ and Python implementations with automatic fallback - Protocol-based architecture (interpolatepy/protocols.py) — structural typing contracts enabling algorithm interchangeability - 16 C++ examples demonstrating every algorithm family - Expanded documentation — new tutorials (path planning, quaternion interpolation), architecture guide, and updated API reference Breaking Changes - Dropped Python 3.10 support - Version bumped from 2.0.1 to 3.0.0 - Removed requirements.txt / requirements-dev.txt in favor of pyproject.toml dependency groups - __init__.py public API reorganized with adapter-based exports Other Changes - Modernized GitHub Actions workflows for pyproject.toml-based dependency management - Added docs optional dependency group - Fixed package discovery to include _adapters subpackage
2 parents a0194fd + e2c6562 commit a9b8fa1

145 files changed

Lines changed: 18111 additions & 259 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
steps:
3333
- name: Checkout repository
3434
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
3537

3638
- name: Set up Python
3739
uses: actions/setup-python@v5
@@ -42,8 +44,7 @@ jobs:
4244
- name: Install dependencies
4345
run: |
4446
python -m pip install --upgrade pip
45-
pip install -r requirements-dev.txt
46-
pip install -e .
47+
pip install -e '.[docs]'
4748
4849
- name: Build documentation
4950
run: |

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v5
1515
with:
16-
python-version: '3.11'
16+
python-version: '3.12'
1717
- uses: pre-commit/action@v3.0.1

.github/workflows/publish.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,26 @@ on:
77
jobs:
88
deploy:
99
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
13+
environment: pypi
1014
steps:
1115
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
1218
- name: Set up Python
1319
uses: actions/setup-python@v5
1420
with:
1521
python-version: '3.12'
16-
- name: Install dependencies
22+
cache: 'pip'
23+
- name: Install build tools
1724
run: |
1825
python -m pip install --upgrade pip
19-
pip install --upgrade setuptools
20-
pip install --upgrade build
21-
pip install --upgrade twine
22-
pip install -r requirements.txt
23-
- name: Build and publish
24-
env:
25-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
26-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
27-
run: |
28-
python -m build
29-
python -m twine upload dist/*
26+
pip install build twine
27+
- name: Build package
28+
run: python -m build
29+
- name: Verify package
30+
run: twine check dist/*
31+
- name: Publish to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,32 @@ on:
88
branches: [ main, master ]
99

1010
jobs:
11-
build-linux:
12-
runs-on: ubuntu-latest
11+
test:
12+
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15+
os: [ubuntu-latest, macos-latest]
1516
python-version: ['3.11', '3.12', '3.13']
1617
steps:
1718
- uses: actions/checkout@v4
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install -r requirements-dev.txt
26-
pip install -e .
27-
- name: Testing with coverage
28-
run: |
29-
python -m pytest tests --cov=interpolatepy --cov-report=xml --cov-report=term-missing
30-
- name: Upload coverage to Codecov
31-
uses: codecov/codecov-action@v5
3219
with:
33-
file: ./coverage.xml
34-
flags: unittests
35-
name: codecov-umbrella
36-
fail_ci_if_error: false
37-
38-
build-macos:
39-
runs-on: macos-latest
40-
strategy:
41-
matrix:
42-
python-version: ['3.11', '3.12', '3.13']
43-
steps:
44-
- uses: actions/checkout@v4
20+
fetch-depth: 0
4521
- name: Set up Python ${{ matrix.python-version }}
4622
uses: actions/setup-python@v5
4723
with:
4824
python-version: ${{ matrix.python-version }}
25+
cache: 'pip'
4926
- name: Install dependencies
5027
run: |
5128
python -m pip install --upgrade pip
52-
pip install -r requirements-dev.txt
53-
pip install -e .
29+
pip install -e '.[test]'
5430
- name: Testing with coverage
5531
run: |
5632
python -m pytest tests --cov=interpolatepy --cov-report=xml --cov-report=term-missing
5733
- name: Upload coverage to Codecov
5834
uses: codecov/codecov-action@v5
5935
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
6037
file: ./coverage.xml
6138
flags: unittests
6239
name: codecov-umbrella

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,13 @@ venv.bak/
141141
.history
142142

143143
CLAUDE.md
144+
145+
################################
146+
########### C++ BUILD ##########
147+
################################
148+
cpp/build/
149+
*.o
150+
*.a
151+
*.so
152+
*.dylib
153+
compile_commands.json

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ repos:
1212
- id: check-toml
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: 'v0.12.8'
15+
rev: 'v0.15.7'
1616
hooks:
1717
- id: ruff
1818
types_or: [python, pyi, jupyter]
1919
args: [ --fix, --exit-non-zero-on-fix, --preview ]
2020

2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v1.17.1
22+
rev: v1.19.1
2323
hooks:
2424
- id: mypy
2525
args: [--ignore-missing-imports]

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# InterpolatePy
22

3-
![Python](https://img.shields.io/badge/python-3.10+-blue)
3+
![Python](https://img.shields.io/badge/python-3.11+-blue)
44
[![PyPI Downloads](https://static.pepy.tech/badge/interpolatepy)](https://pepy.tech/projects/interpolatepy)
55
[![pre-commit](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/pre-commit.yml)
66
[![ci-test](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/test.yml/badge.svg)](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/test.yml)
@@ -10,9 +10,9 @@
1010

1111
InterpolatePy provides 20+ algorithms for smooth trajectory generation with precise control over position, velocity, acceleration, and jerk. From cubic splines and B-curves to quaternion interpolation and S-curve motion profiles — everything you need for professional motion control.
1212

13-
**⚡ Fast:** Vectorized NumPy operations, ~1ms for 1000-point cubic splines
14-
**🎯 Precise:** Research-grade algorithms with C² continuity and bounded derivatives
15-
**📊 Visual:** Built-in plotting for every algorithm
13+
**⚡ Fast:** Optional C++ backend with pybind11; pure-Python fallback uses vectorized NumPy
14+
**🎯 Precise:** Research-grade algorithms with C² continuity and bounded derivatives
15+
**📊 Visual:** Built-in plotting for every algorithm
1616
**🔧 Complete:** Splines, motion profiles, quaternions, and path planning in one library
1717

1818
---
@@ -23,7 +23,7 @@ InterpolatePy provides 20+ algorithms for smooth trajectory generation with prec
2323
pip install InterpolatePy
2424
```
2525

26-
**Requirements:** Python ≥3.10, NumPy ≥2.0, SciPy ≥1.15, Matplotlib ≥3.10
26+
**Requirements:** Python ≥3.11, NumPy ≥2.3, SciPy ≥1.16, Matplotlib ≥3.10.5
2727

2828
<details>
2929
<summary><strong>Development Installation</strong></summary>
@@ -222,12 +222,23 @@ plt.show()
222222

223223
## Performance & Quality
224224

225-
- **Fast:** Vectorized NumPy operations, optimized algorithms
226-
- **Reliable:** 85%+ test coverage, continuous integration
227-
- **Modern:** Python 3.10+, strict typing, dataclass-based APIs
225+
- **Fast:** Optional C++ backend (Eigen + pybind11) for maximum performance; pure-Python fallback uses vectorized NumPy
226+
- **Reliable:** 85%+ test coverage, continuous integration, 142 additional C++ unit tests
227+
- **Modern:** Python 3.11+, strict typing, dataclass-based APIs
228228
- **Research-grade:** Peer-reviewed algorithms from robotics literature
229229

230-
**Typical Performance:**
230+
**C++ Backend:**
231+
232+
InterpolatePy includes an optional compiled C++ extension for performance-critical workloads. The API is identical regardless of backend:
233+
234+
```python
235+
import interpolatepy
236+
print(f"C++ backend: {interpolatepy.HAS_CPP}") # True if extension is available
237+
```
238+
239+
Set `INTERPOLATEPY_NO_CPP=1` to force pure-Python mode.
240+
241+
**Typical Performance (pure-Python):**
231242
- Cubic spline (1000 points): ~1ms
232243
- B-spline evaluation (10k points): ~5ms
233244
- S-curve trajectory planning: ~0.5ms
@@ -256,6 +267,8 @@ ruff format interpolatepy/
256267
ruff check interpolatepy/
257268
mypy interpolatepy/
258269

270+
# Run all pre-commit hooks
271+
pre-commit run --all-files
259272
```
260273
</details>
261274

codecov.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,3 @@ ignore:
2323
- "tests/*"
2424
- "docs/*"
2525
- "examples/*"
26-
- "setup.py"
27-
- "**/__init__.py"

0 commit comments

Comments
 (0)