Problem
nomad.stop_detection.utils.summarize_stops supports custom aggregation of passthrough columns through passthrough_agg, but the public direct-to-stop-table APIs do not expose and forward that argument consistently. Callers therefore fall back to label APIs and external stop summarization when a stop-level field such as an attributed location_id needs modal aggregation.
Grid-Based has an additional gap: summarize_stop_grid always takes the first passthrough value, so its direct stop-table API cannot apply the same custom aggregation as other stop-detection families.
Required behavior
- Add an explicit
passthrough_agg=None parameter to the public single-user direct-to-stop-table APIs and their *_per_user wrappers.
- Forward it from each per-user wrapper to its single-user stop-table function, and from there only to stop summarization.
- Do not forward summarization arguments into label APIs.
- Extend
summarize_stop_grid, grid_based, and grid_based_per_user with equivalent custom passthrough aggregation behavior.
- Preserve existing first-value behavior for passthrough columns without a custom aggregator.
- Preserve canonical
user_id passthrough behavior and empty stop-table schemas.
Tests
- Cover a modal nullable string and integer
location_id through representative direct and per-user stop-table APIs.
- Cover Grid-Based explicitly, including populated and all-noise results.
- Verify the label APIs are not given
passthrough_agg.
- Verify existing calls using only
passthrough_cols remain unchanged.
This pull request includes code written with the assistance of AI. The code has not yet been reviewed by a human (remove this disclosure after human review).
Problem
nomad.stop_detection.utils.summarize_stopssupports custom aggregation of passthrough columns throughpassthrough_agg, but the public direct-to-stop-table APIs do not expose and forward that argument consistently. Callers therefore fall back to label APIs and external stop summarization when a stop-level field such as an attributedlocation_idneeds modal aggregation.Grid-Based has an additional gap:
summarize_stop_gridalways takes the first passthrough value, so its direct stop-table API cannot apply the same custom aggregation as other stop-detection families.Required behavior
passthrough_agg=Noneparameter to the public single-user direct-to-stop-table APIs and their*_per_userwrappers.summarize_stop_grid,grid_based, andgrid_based_per_userwith equivalent custom passthrough aggregation behavior.user_idpassthrough behavior and empty stop-table schemas.Tests
location_idthrough representative direct and per-user stop-table APIs.passthrough_agg.passthrough_colsremain unchanged.This pull request includes code written with the assistance of AI. The code has not yet been reviewed by a human (remove this disclosure after human review).