Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units for pace in ActivitiesDB incorrect when reading from an account that uses metric #248

Open
garenkwan opened this issue Oct 28, 2024 · 2 comments

Comments

@garenkwan
Copy link

Describe the bug
When running activities.ipynb, I noticed that the Pace value is displaying a per mile pace, but the rest of the DB is metric, See attached imaged.

image

To Reproduce
Steps to reproduce the behavior:

  1. Garmin Connect units set to kmph
  2. Create database using garmindb_cli.py
  3. Run activities.ipynb
  4. See error

Expected behavior
The pace calculations should be per kilometer.

Additional context
I have traced this and would like to suggest a change to ActivityFitFileProcessor._write_steps_entry().
My current guess is that GarminConnect stores the pace information as mph which converts nicely to the numbers shown in the attached image. I tried working on a solution for this, but am not sure where to get the measurement system information in this processor file to write an if ... else .. statement to handle this.

@tcgoetz
Copy link
Owner

tcgoetz commented Nov 2, 2024

Is the speed correct? The pace is derived form the speed:

        'avg_pace'                          : fitfile.conversions.perhour_speed_to_pace(message_fields.avg_speed),

@garenkwan
Copy link
Author

garenkwan commented Dec 15, 2024

Yes the speed is correct in kph, so that's why I'm suspecting it is a conversion issue.
Taking the last row, a 12.3kph speed is a kilometer pace of 4:48.6 and a mile pace of 7:51.2 which is what is being shown in the screen shot.

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

No branches or pull requests

2 participants