@@ -154,10 +154,11 @@ from sport_activities_features.tcx_manipulation import TCXFile
154154
155155# Class for reading TCX files
156156tcx_file= TCXFile()
157- data = tcx_file.read_one_file(" path_to_the_file" ) # Represents data as dictionary of lists
157+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
158+ data = tcx_file.extract_activity_data(tcx_exercise) # Represents data as dictionary of lists
158159
159160# Alternative choice
160- data = tcx_file.read_one_file( " path_to_the_file " , numpy_array = True ) # Represents data as dictionary of numpy.arrays
161+ data = tcx_file.extract_activity_data(tcx_exercise , numpy_array = True ) # Represents data as dictionary of numpy.arrays
161162
162163```
163164
@@ -169,10 +170,11 @@ from sport_activities_features.gpx_manipulation import GPXFile
169170gpx_file= GPXFile()
170171
171172# Read the file and generate a dictionary with
172- data = gpx_file.read_one_file(" path_to_the_file" ) # Represents data as dictionary of lists
173+ gpx_exercise = gpx_file.read_one_file(" path_to_the_file" )
174+ data = gpx_file.extract_activity_data(gpx_exercise) # Represents data as dictionary of lists
173175
174176# Alternative choice
175- data = gpx_file.read_one_file( " path_to_the_file " , numpy_array = True ) # Represents data as dictionary of numpy.arrays
177+ data = gpx_file.extract_activity_data(gpx_exercise , numpy_array = True ) # Represents data as dictionary of numpy.arrays
176178
177179```
178180
@@ -185,7 +187,8 @@ from sport_activities_features.plot_data import PlotData
185187
186188# Read TCX file
187189tcx_file = TCXFile()
188- activity = tcx_file.read_one_file(" path_to_the_file" )
190+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
191+ activity = tcx_file.extract_activity_data(tcx_exercise)
189192
190193# Detect hills in data
191194Hill = HillIdentification(activity[' altitudes' ], 30 )
@@ -211,7 +214,8 @@ from sport_activities_features.tcx_manipulation import TCXFile
211214
212215# Reading the TCX file
213216tcx_file = TCXFile()
214- activity = tcx_file.read_one_file(" path_to_the_data" )
217+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
218+ activity = tcx_file.extract_activity_data(tcx_exercise)
215219
216220# Identifying the intervals in the activity by power
217221Intervals = IntervalIdentificationByPower(activity[" distances" ], activity[" timestamps" ], activity[" altitudes" ], 70 )
@@ -231,7 +235,8 @@ from sport_activities_features import TCXFile
231235
232236# Read TCX file
233237tcx_file = TCXFile()
234- tcx_data = tcx_file.read_one_file(" path_to_file" )
238+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
239+ tcx_data = tcx_file.extract_activity_data(tcx_exercise)
235240
236241# Configure visual crossing api key
237242visual_crossing_api_key = " weather_api_key" # https://www.visualcrossing.com/weather-api
@@ -285,8 +290,8 @@ from sport_activities_features.tcx_manipulation import TCXFile
285290
286291# Read TCX file
287292tcx_file = TCXFile()
288-
289- integral_metrics = tcx_file.extract_integral_metrics(" path_to_the_file " )
293+ tcx_exercise = tcx_file.read_one_file( " path_to_the_file " )
294+ integral_metrics = tcx_file.extract_integral_metrics(tcx_exercise )
290295
291296print (integral_metrics)
292297
@@ -299,7 +304,9 @@ from sport_activities_features.tcx_manipulation import TCXFile
299304
300305# read TCX file
301306tcx_file = TCXFile()
302- tcx_data = tcx_file.read_one_file(" path_to_the_file" )
307+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
308+ tcx_data = tcx_file.extract_activity_data(tcx_exercise)
309+
303310
304311# configure visual crossing api key
305312visual_crossing_api_key = " API_KEY" # https://www.visualcrossing.com/weather-api
@@ -351,7 +358,8 @@ from sport_activities_features.tcx_manipulation import TCXFile
351358
352359# Reading the TCX file.
353360tcx_file = TCXFile()
354- activity = tcx_file.read_one_file(' path_to_the_data' )
361+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
362+ activity = tcx_file.extract_activity_data(tcx_exercise)
355363
356364# Converting the read data to arrays.
357365positions = np.array([* activity[' positions' ]])
@@ -381,7 +389,8 @@ Identify interruption events from a TCX or GPX file.
381389
382390# read TCX file (also works with GPX files)
383391tcx_file = TCXFile()
384- tcx_data = tcx_file.read_one_file(" path_to_the_data" )
392+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
393+ tcx_data = tcx_file.extract_activity_data(tcx_exercise)
385394
386395"""
387396Time interval = time before and after the start of an event
@@ -434,7 +443,8 @@ from sport_activities_features import ElevationIdentification
434443from sport_activities_features import TCXFile
435444
436445tcx_file = TCXFile()
437- tcx_data = tcx_file.read_one_file(' path_to_file' )
446+ tcx_exercise = tcx_file.read_one_file(" path_to_the_file" )
447+ tcx_data = tcx_file.extract_activity_data(tcx_exercise)
438448
439449elevations = ElevationIdentification(tcx_data[' positions' ])
440450""" Adds tcx_data['elevation'] = eg. [124, 21, 412] for each position"""
0 commit comments