The correct_invalid_trajectories feature in pedpy/preprocessing/trajectory_projector.py currently uses custom implementations for geometric calculations and Python loops for data processing. This issue tracks the refactoring to leverage Numpy's vectorization capabilities and Shapely's built-in geometric functions, which will improve performance, readability, and maintainability.
Benefits of refactoring:
- Performance: Numpy vectorized operations are significantly faster than Python loops when processing large trajectory datasets
- Reliability: Using well-tested library functions reduces the risk of bugs in geometric calculations
- Maintainability: Less custom code means fewer potential error sources and easier future modifications
- Readability: Library functions often express intent more clearly than custom implementations
The correct_invalid_trajectories feature in pedpy/preprocessing/trajectory_projector.py currently uses custom implementations for geometric calculations and Python loops for data processing. This issue tracks the refactoring to leverage Numpy's vectorization capabilities and Shapely's built-in geometric functions, which will improve performance, readability, and maintainability.
Benefits of refactoring: