Skip to content

jalbiero/vo2max-tracker

Repository files navigation

VO2Max Tracker

Garmin (devices and connect app/website) does not show your VO2Max as a floating point number. Instead it shows it as an integer value, so it can be difficult to see what your device really measures in each training session in order get a more precise feedback.

This simple application tracks the VO2Max value that your device has calculated in each training session. Be aware that the VO2Max showed by your device status (or Garmin Connect) can differ from the one that was measured (the value saved in the .FIT activity file). The watch applies a correction after the activity was finalized/saved. See Interpreting results later in this document for more information.

Features

  • Chart of your VO2Max grouped by sport

    Chart plot

  • Support any sport where VO2Max is calculated (walking, running, cycling, swimming, etc)

  • Activities

    • Support for raw .fit files (activities stored in your device)
    • Support for compressed fit files (.zip files) (activities exported from Garmin Connect)
  • Export your activities (only values defined in class FitData are exported)

    • Support for CVS files (easily read by Excel or any other spreedsheet)
    • Support for JSON files
  • Cache of parsing results to improve execution speed

Interpreting results

Let's see the following chart:

Chart plot

  • Jump in VO2Max
    • Values greater than "a value and a half" could be considered as a VO2Max improvement (does not always happen, but several values above the "half" for sure will end up in a new VO2Max).
    • Values stored in the .FIT activiy file are "corrected" by the device after the activity is finalized (in general, the device's VO2Max is one integer point above the .FIT's VO2Max). That's why the current VO2Max of 53 was upgraded to 54 when the calculated .FIT number hit the 52.6 value.
  • Productive trainning status
    • When there is a breaking point in the VO2Max curve your device will show a "productive" status.

Requirements

  • Python 3.9 or newer (it could be run on older versions, but it was not tested)
  • Poetry Package Manager.

Setup

  1. Install Python and Poetry as noted in previous section

  2. Download this project from git, decompress the .zip file wherever you want in your PC.

  3. Connect your device,

  4. Copy the content of the device folder activity (or ACTIVITY) into the project folder activities (you can change this default location if you want, see Configuration)

  5. If you do not want to copy the activities from your device, you can download them from Garmin Connect (one by one). Just select/view the activity you want to download, click on the upper right gear and select "Export Original". The zipped activity should be saved in the aforementioned activity folder. It is not necessary to decompress the file.

    Export activity

  6. Execute the application using the provided script for your platform (run_linux.sh, run_mac.sh, or run_win.ps1)

Run

In order to run the application just execute one of the provided scripts via command line or file explorer. Be aware that the first run will take some time due to the following things:

  1. It is necessary to download the runtime software dependencies
  2. Decoding (parsing) a FIT file is slow (at least in Python) so dependending on the number of activities you will have to wait. Don't worry, the decoding results are cached so the next time the start up will be almost instant (unless you add new activities that need to be parsed).

e.g. Run VO2Max Tracker on Linux (APP_DIRECTORY is where you downloaded the app)

$ APP_DIRECTORY/run_linux.sh

Export

Export to CVS

$ APP_DIRECTORY/run_linux.sh --csv --output my_activities.csv

Export to JSON

$ APP_DIRECTORY/run_linux.sh --json --output my_activities.json

Help

For a full list of options just invoke its command line help

$ APP_DIRECTORY/run_linux.sh --help

usage: app [-h] [-v] [-r] [-c] [-j] [-o OUTPUT]

optional arguments:
  -h, --help            show this help message and exit

General options:
  -v, --version         show VO2MaxReader version
  -r, --rcache          Recreate FIT cache. The application start-up will be very slow, be patience.

Export options:
  -c, --csv             Export all activities in CSV format
  -j, --json            Export all activities in JSON format
  -o OUTPUT, --output OUTPUT
                        Output file (when not specified, './export_output.txt' will be used

Configuration

For a custom configuration, just edit the file vo2max_tracker/config.py

Disclaimer

VO2Max Tracker was developed and tested on Linux (openSUSE 15.4 with Anaconda3 2022-10/Python 3.9.13, bash 4.4.23, zsh 5.6 and PowerShell for Linux 7.2.3) with data from Garmin FR-945 and FR-920. Older devices like the latter currently have partial support, so it is possible that no all information will be shown on the tooltip. VO2Max Tracker was also tested on Windows 10 (Python 3.11.1). I am sorry, but I do not have a Mac, so let me know if you have any issue on macOS.

Troubleshooting

Error when trying to execute run_win.ps1 on Windows

If you get the following error:

PS C:\Users\Javier\vo2max_tracker> .\run_win.ps1
.\run_win.ps1 : File C:\Users\Javier\vo2max_tracker\run_win.ps1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\run_win.ps1
+ ~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Then you need to change the execution policy. Open a PowerShell terminal and paste the following Cmdlet:

Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "RemoteSigned"

If anyone know how to change the execution policy just for run_win.ps1 script (instead of all scripts for the current user), please let me know, thanks in advance.

Chart is too small

It is quite possible that you have a High DPI monitor. Try increasing the value of DPI property in the configuration file. A normal value is 100, but, as a sort of compromise between high and low resolution monitors, the default one was set to 150 (1.5 x). Try setting it to 200 (2x) or greater.

Other related tools

For developers

If you use VSCode or VSCodium for development, you must use a virtual environment inside the project (e.g. vo2max-tracker/.venv directory) as noted in this stack overflow answer

The following examples assume a terminal located in vo2max-tracker directory (or vo2max-tracker-main if you downloaded the .zip file instead of cloning the repository)

Install full dependencies

$ poetry install

Run application

$ poetry run app

Run tests and code tools (isort, autopep and mypy)

$ poetry run tests [optional_arguments_for_pytest]

Run tools without tests

$ poetry run tools