Development
Setting up Development Environment
# Clone repository
git clone https://github.com/robodreamer/dhb-xr.git
cd dhb_xr
# Install in development mode with all dependencies
pip install -e ".[dev,all]"
# Or using Pixi (recommended)
pixi install
Running Tests
# Run all tests
pytest tests/
# Run specific test file
pytest tests/test_encoder.py
# Run with coverage
pytest tests/ --cov=src/dhb_xr --cov-report=html
# Run tests for specific backends
pixi run test-casadi # CasADi optimization tests
Code Quality
# Format code
ruff format src/ tests/
# Lint code
ruff check src/ tests/
# Type checking
mypy src/dhb_xr
Building Documentation
# Build documentation
mkdocs build
# Serve documentation locally
mkdocs serve
Project Structure
dhb_xr/
├── src/dhb_xr/
│ ├── core/ # Core types and geometry
│ ├── encoder/ # DHB encoding functions
│ ├── decoder/ # DHB decoding functions
│ ├── optimization/ # Trajectory optimization
│ ├── database/ # Motion storage and retrieval
│ ├── tokenization/ # VQ-VAE tokenization
│ ├── losses/ # Imitation learning losses
│ ├── visualization/ # Plotting utilities
│ └── utils/ # Additional utilities
├── tests/ # Unit and integration tests
├── examples/ # Example scripts
├── docs/ # Documentation
└── notebooks/ # Jupyter notebooks
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Release Process
- Update version in
pyproject.toml
- Update CHANGELOG.md
- Create git tag
- Push to main branch
- GitHub Actions will build and publish to PyPI