Skip to content

v25.0.0 - Major Feature Update: Deep Learning Integration, 3D Support, and Performance Improvements

Latest

Choose a tag to compare

@justinshenk justinshenk released this 21 Oct 19:48
· 3 commits to master since this release

🚀 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

🧪 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.