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

Error with .fit activities with NoneType subsport #84

Open
antonmosich opened this issue Jan 13, 2024 · 4 comments
Open

Error with .fit activities with NoneType subsport #84

antonmosich opened this issue Jan 13, 2024 · 4 comments
Labels
component: activity files status: information needed Further information is requested type: bug Something isn't working

Comments

@antonmosich
Copy link

I just tried out running 0.17.1 and encountered the following error:

Parse activity files:   2%|█                                                       | 203/11221 [00:08<02:02, 90.08it/s]2024-01-13 12:28:25 geo_activity_playground.importers.directory ERROR Encountered a problem with path=PosixPath('Activities/filename.fit'), see details below.
Parse activity files:   2%|█                                                       | 207/11221 [00:08<07:30, 24.47it/s]
Traceback (most recent call last):
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/bin/.geo-activity-playground-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/lib/python3.11/site-packages/geo_activity_playground/__main__.py", line 95, in main
    options.func(options)
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/lib/python3.11/site-packages/geo_activity_playground/__main__.py", line 70, in <lambda>
    make_activity_repository(options.basedir),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/lib/python3.11/site-packages/geo_activity_playground/__main__.py", line 103, in make_activity_repository
    import_from_directory()
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/lib/python3.11/site-packages/geo_activity_playground/importers/directory.py", line 41, in import_from_directory
    activity_meta_from_file, timeseries = read_activity(path)
                                          ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/lib/python3.11/site-packages/geo_activity_playground/core/activity_parsers.py", line 44, in read_activity
    metadata, timeseries = read_fit_activity(path, opener)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/88a9n13fznshkf45x2a9sd5fcy27vr6p-geo-activity-playground-0.17.1/lib/python3.11/site-packages/geo_activity_playground/core/activity_parsers.py", line 175, in read_fit_activity
    metadata["kind"] += " " + values["sub_sport"]
                        ~~~~^~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

I tried packaging geo-activity-playground in nix, so that's why the paths for the files are the way they are, but this shouldn't be causing this issue.
I can send you the activity file via some other channel if you want that.

@martin-ueding
Copy link
Owner

It's a bug I've introduced with version 0.17.1. I've fixed it in the just released 0.17.2.

@martin-ueding martin-ueding added the type: bug Something isn't working label Jan 14, 2024
@antonmosich
Copy link
Author

Thanks for fixing, now it errors on another file, where the sub_sport seems to be an integer with essentially the same error.

@martin-ueding
Copy link
Owner

That's annoying. The FIT documentation said something about it being an enumeration type. For my files from the Garmin Venu Sq watch it is a string. Either way, I now force it to be a string. It could be that in your case there are just boring numbers. Try out version 0.17.5, that should at least import everything.

If you'd like me to take a look at your file, you could send it to mu@martin-ueding.de and I'll try to import it on my system.

@martin-ueding
Copy link
Owner

I've managed to import one of your files. The other files doesn't contain any FIT frames with geo data, as I've written in the e-mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: activity files status: information needed Further information is requested type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants