firefly-cpp / sport-activities-features

A minimalistic toolbox for extracting features from sports activity files written in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tcxreader issue

firefly-cpp opened this issue · comments

activity = tcx_file.read_one_file('dead_end.tcx')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/lib/python3.11/site-packages/sport_activities_features/tcx_manipulation.py", line 57, in read_one_file
tcx = TCXReader().read(filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tcxreader/tcxreader.py", line 48, in read
self.trackpoint_parser(tcx_point, trackpoint)
File "/usr/lib/python3.11/site-packages/tcxreader/tcxreader.py", line 116, in trackpoint_parser
tcx_point.time = datetime.datetime.strptime(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2021-09-29T15:17:30Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

I have checked the project.lock file. You are still using 0.4.2 version, dependencies specify 0.4.4. Please update the dependency. I have tried running this myself and dates of format 2021-09-29T15:17:30Z can be parsed.

From lock file:

[[package]]
name = "tcxreader"
version = "0.4.2"
description = "tcxreader is a reader for Garmin’s TCX file format. It also works well with missing data!"
category = "main"
optional = false
python-versions = ">=3.6"