Improved trajectory_projector calculations through vectorization#542
Conversation
…correct adjustments
There was a problem hiding this comment.
Overall looks great, have only looked at the latest three commits containing the changes for the vectorization improvement.
It would be great if you could move the shapely normalization to the constructor of the WalkableArea (#521 and see comment). And if you could take a look at the missed lines in the code coverage and construct test cases that would cover them.
…edPy into use_numpy_functions
JuleAdrian
left a comment
There was a problem hiding this comment.
Looks good overall! The method does not appear in the API references.
I think we should make an entry in methods.rst.
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #518 #519 #520 #521
The trajectory_projector functions now have significantly better performance due to vectorization. Furthermore, I replaced large parts of the calculations with shapely and numpy methods. The functions now work directly on Shapely geometries, so a geo_data structure is no longer necessary.
The correct_invalid_trajectory function now also returns a list of all person IDs containing invalid trajectory points (similar to the outlier detection). This makes it possible to plot the modified trajectories before and after correction for easier comparison. I also added corresponding code to the preprocessing notebook.