feat: use 'flying' mode for speeds >150mph, keep 'transit' for rail
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
2026-03-14 03:26:08 +00:00
parent cc8bd4ef00
commit 334a1a0f88

View File

@@ -45,6 +45,8 @@ def _activity_type_to_travel_mode(activity_type):
return None
if t == 'IN_RAIL_VEHICLE':
return 'transit'
if t == 'IN_PASSENGER_VEHICLE' or t == 'FLYING':
return 'flying'
if t in VEHICLE_ACTIVITIES:
return 'driving'
if t in WALKING_ACTIVITIES:
@@ -57,7 +59,7 @@ def _activity_type_to_travel_mode(activity_type):
def _speed_to_travel_mode(max_speed_mph):
"""Infer travel mode from maximum speed observed along a path."""
if max_speed_mph > 150:
return 'transit' # flight
return 'flying'
if max_speed_mph > 15:
return 'driving'
if max_speed_mph > 3: