Repository navigation
v25.0.0 - Major Feature Update: Deep Learning Integration, 3D Support, and Performance Improvements
Latest🚀 Major Features
Deep Learning Integration
- Data Augmentation: 5 methods (rotate, noise, reverse, scale, subsample) for training robust models
- Sequence Processing: Padding, truncation, and normalization for batch training
- PyTorch Integration: Tensor conversion with graceful numpy fallback
- Feature Extraction: ML-ready features (displacement, speed, turn_angle, heading, acceleration)
- Dataset Utilities: train_test_split with shuffle and random_state support
- Demo Notebook: Complete example using public jaguar tracking dataset
3D Trajectory Support
- Full x, y, z coordinate handling throughout the library
- 3D distance, displacement, and plotting capabilities
- Backward compatible - 2D trajectories work exactly as before
GPS/Lat-Long Support
- Convert GPS coordinates to local x, y in meters (Haversine formula)
- Create trajectories directly from lat/lon arrays
- Preserves original GPS coordinates alongside local coordinates
Visualization Enhancements
- Interactive 2D/3D plots with plotly (zoom, pan, rotate)
- Heatmap visualization showing time spent in each location
- Speed and acceleration profile plots
- Comprehensive 4-panel trajectory analysis
Performance Optimizations
- Parallel batch processing using joblib (10-100x speedup for large datasets)
- Replaced inefficient np.append() calls (major speedup in calc_flow_angles)
- Caching mechanism for expensive computations
🔧 Bug Fixes & Improvements
- Fixed pandas 2.0+ compatibility (deprecated pd.datetime)
- Fixed lambda closure bug in date parsing
- Fixed missing inplace=True operations (6 critical silent failures)
- Replaced 18 generic exceptions with specific types
- Made PyTorch, plotly, and joblib optional dependencies with graceful fallbacks
- Fixed scipy deprecated window name (hanning → hann)
⚠️ Breaking Changes
- Python 3.8+ Required: Dropped Python 3.6 and 3.7 support (EOL versions)
- Updated minimum dependencies for better compatibility
📦 Installation
```bash
Core package
pip install traja
With deep learning extras (PyTorch, plotly, joblib)
pip install traja[dl]
All optional dependencies
pip install traja[all]
```
📚 Documentation
- Documentation: https://traja.readthedocs.io/en/latest/
- Deep Learning Guide: https://traja.readthedocs.io/en/latest/deep_learning.html
- API Reference: https://traja.readthedocs.io/en/latest/reference.html
🧪 Testing
- 46 new tests added for all features
- All tests pass on Python 3.8-3.12
- Tests work with and without optional dependencies
See CHANGELOG.md for complete details.