Add pref for use_raw_gpx_speed; still need to do tests and client UI bits

This commit is contained in:
Joshua Taillon
2023-05-14 22:40:03 -06:00
parent 518251d442
commit a98057c936
6 changed files with 53 additions and 4 deletions

View File

@ -73,6 +73,7 @@ def get_gpx_info(
stopped_speed_threshold: float,
update_map_data: Optional[bool] = True,
update_weather_data: Optional[bool] = True,
use_raw_gpx_speed: Optional[bool] = False
) -> Tuple:
"""
Parse and return gpx, map and weather data from gpx file
@ -128,7 +129,8 @@ def get_gpx_info(
if update_map_data:
map_data.append([point.longitude, point.latitude])
moving_data = segment.get_moving_data(
stopped_speed_threshold=stopped_speed_threshold
stopped_speed_threshold=stopped_speed_threshold,
raw=use_raw_gpx_speed
)
if moving_data:
calculated_max_speed = moving_data.max_speed

View File

@ -299,10 +299,12 @@ def process_one_gpx_file(
absolute_gpx_filepath = None
absolute_map_filepath = None
try:
gpx_data, map_data, weather_data = get_gpx_info(
params['file_path'], stopped_speed_threshold
)
auth_user = params['auth_user']
gpx_data, map_data, weather_data = get_gpx_info(
gpx_file=params['file_path'],
stopped_speed_threshold=stopped_speed_threshold,
use_raw_gpx_speed=auth_user.use_raw_gpx_speed
)
workout_date, _ = get_workout_datetime(
workout_date=gpx_data['start'],
date_str_format=None if gpx_data else '%Y-%m-%d %H:%M',