Skip to content

Customer reqs/8596 speed up otanalytics by using vectorized operations - #741

Merged
briemla merged 137 commits into
mainfrom
customer-reqs/8596-speed-up-otanalytics-by-using-vectorized-operations
Oct 27, 2025
Merged

briemla merged 137 commits into
mainfrom
customer-reqs/8596-speed-up-otanalytics-by-using-vectorized-operations

Conversation

@briemla

@briemla briemla commented Sep 18, 2025 •

Copy link
Copy Markdown
Contributor

OP#8596
OP#8685
OP#8740

Summary

This pull request introduces extensive improvements and changes to a Python-based analytics project. The changes include significant shift towards leveraging Polars (polars library), replacing older methods with Polars-based implementations for track datasets and geometries. Additionally, tighter type hinting, improved support for metadata handling, and enabling .feather file processing are included.

  • Introduced Polars support (polars) for track datasets & geometry operations.
  • Replaced older PandasTrackDataset with PolarsTrackDataset where applicable.
  • Introduced functionalities to convert .ottrk data into .feather file formats with metadata export.
  • Added utilities & tests comparing Polars vs Pandas implementations.
  • Cleaned up redundant methods (e.g., TrackToVideoRepository) and optimized repository logic.

Main Changes

Dataset Enhancements:

  • Added PolarsTrackDataset backed by PolarsTrackIdSet using polars.Series.
  • Enhanced geometry operations via PolarsTrackGeometryDataset.
  • Comprehensive replacement of PandasTrackDataset in applicable usage areas.

Metadata Handling:

  • .Feather parser (FeathersParser) support for tracks, with backward compatibility for .ottrk.
  • Detection metadata now managed efficiently across the system.

Bug Fixes & Tests:

  • Fixed logic around geometries, ensuring comprehensive intersection validations.
  • Added several benchmarks for new datasets and .feather-based parsing.

External Libraries:

  • Added dependencies polars and pyarrow to leverage Arrow/Feather formats effectively.

Critical Notes

  • General project performance likely impacted positively, especially for large datasets.
  • Introduced benchmarks explicitly comparing legacy methods against Polars-based workflows.

briemla and others added 22 commits October 8, 2025 17:01
… in `convert_ottrk_to_feathers.py` and `feathers_parser.py`.
…a and add corresponding assertions in `test_feathers_parser.py`.
…alytics-by-using-vectorized-operations' into customer-reqs/8596-speed-up-otanalytics-by-using-vectorized-operations
Sort dataframe before processing
…-tests-do-not-verify-eventlist-export' into customer-reqs/8596-speed-up-otanalytics-by-using-vectorized-operations

# Conflicts:
#	OTAnalytics/plugin_prototypes/eventlist_exporter/eventlist_exporter.py
#	pyproject.toml
#	tests/regression_otanalytics.py
#	tests/utils/assertions.py
#	uv.lock
Compare events only as pandas data frames to be much faster.
Sort polars track dataset the same way as with previous parsers
Compare datetime values with 1ms precision.
Add debugging function
…alytics-by-using-vectorized-operations' into customer-reqs/8596-speed-up-otanalytics-by-using-vectorized-operations
@briemla
briemla enabled auto-merge October 27, 2025 10:16
@randy-seng
randy-seng self-requested a review October 27, 2025 15:29
@briemla
briemla merged commit a387758 into main Oct 27, 2025
16 of 17 checks passed
@briemla
briemla deleted the customer-reqs/8596-speed-up-otanalytics-by-using-vectorized-operations branch October 27, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants