Skip to content

fix(filters): reject invalid coordinates; report rejections and the threshold profile - #1

Merged
joepetjr merged 2 commits into
mainfrom
fix/gpx-null-island-and-thresholds
Oct 1, 2026
Merged

joepetjr merged 2 commits into
mainfrom
fix/gpx-null-island-and-thresholds

Conversation

@joepetjr

Copy link
Copy Markdown
Contributor

Summary

GPX-1 and GPX-2 from the portfolio remediation plan.

  • Reject NaN, infinite and out-of-range (|lat|>90, |lon|>180) coordinates at intake, before the null-island and statistical tests. They are dropped, never clamped. Bounds are inclusive.
  • Add filter_points_with_report and FilterReport: per-class rejected counts (all seven keys, in application order), an explicit outcome (ok, empty_input, all_rejected), and the effective threshold profile.
  • Name the existing ground-vehicle defaults as GROUND_VEHICLE_PROFILE and make them the single source of the keyword defaults; a test asserts they cannot drift. A run with any changed threshold reports a custom profile, which means "your numbers", not "validated for an activity". No new activity profiles.
  • filter_high_quality_points keeps its signature and return type and delegates to the report form. README and CHANGELOG updated.

Test plan

  • Red first: both new test modules failed at import against origin/main (filter_points_with_report, GROUND_VEHICLE_PROFILE missing).
  • Dispatcher re-run through the slot wrapper: 170 passed in 0.38s (all 7 test files named explicitly); default-config ruff already reports 37 findings on origin/main and CI does not run it, so the two new Optional[] hits follow the file's existing style
  • CI runs pytest plus a no-runtime-deps check only; the repo configures no linter, so none was run.

Acceptance

  • GPX-1: single-point NaN, inf and out-of-range inputs rejected on object, tuple and dict shapes; a mixed track keeps only the valid points as the original objects; all-invalid input reports all_rejected, distinct from empty_input; exact (0,0) is still dropped and counted as null_island; one-axis zeros survive.
  • GPX-2: FilterReport.profile is set on every outcome, including empty and all-rejected; any non-default threshold reports custom; docs state only the ground-vehicle profile exists.

NaN, infinite and out-of-range latitude/longitude are dropped before the null-island and statistical tests. Add filter_points_with_report, which counts rejections per class and reports an explicit outcome.
Name the existing ground-vehicle defaults as GROUND_VEHICLE_PROFILE, make them the single source of the keyword defaults, and have FilterReport.profile state the thresholds a run applied (custom when any differ). No new activity profiles.
@joepetjr
joepetjr merged commit 6f72e53 into main Oct 1, 2026
3 checks passed
@joepetjr
joepetjr deleted the fix/gpx-null-island-and-thresholds branch October 1, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant