From 0206867af5e76092a3f4ed6e3ca83631313c1b9f Mon Sep 17 00:00:00 2001 From: Filip Date: Sun, 16 Mar 2025 14:46:04 +0100 Subject: [PATCH] Example script now also looks for tcx files. --- example.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/example.py b/example.py index 85a02f0..a5261c4 100644 --- a/example.py +++ b/example.py @@ -1,12 +1,19 @@ from analyze_sport_data import heart_rate_dataframe -from analyze_sport_data.file_records import from_fit_file +from analyze_sport_data.file_records import from_fit_file, from_tcx_file from matplotlib.pyplot import show from os import scandir -data = [ +fit_data = [ from_fit_file(file.path, file.name) for file in scandir(".") - if file.name.endswith(".fit") and file.is_file() + if file.name.lower().endswith(".fit") and file.is_file() ] +tcx_data = [ + from_tcx_file(file.path, file.name) for file in scandir(".") + if file.name.lower().endswith(".tcx") and file.is_file() +] + +data = fit_data + tcx_data + heart_rate_dataframe(data).plot() show()