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

Wrong decimal separator when importing activities via Strava API #88

Closed
Oi-sin opened this issue Feb 2, 2024 · 5 comments
Closed

Wrong decimal separator when importing activities via Strava API #88

Oi-sin opened this issue Feb 2, 2024 · 5 comments
Labels
type: bug Something isn't working
Milestone

Comments

@Oi-sin
Copy link

Oi-sin commented Feb 2, 2024

I imported all of my Strava activites using the Strava API setup into a cleaned cache. Unfortunately, the distance information of the activities is identified wrongly, supposedly due a wrongly used decimal separator in the data. (see issue #86 pointing in a similar direction).

image

image

@Oi-sin
Copy link
Author

Oi-sin commented Feb 2, 2024

I just saw another error in the screenshot: the timestamp of the activity is wrong. I suppose Strava stores the time in UTC, while the activity was recorded using CET, i.e. it started at 10:19 am.

@martin-ueding
Copy link
Owner

I screwed around with m and km as units. I think I've fixed some of these issues but haven't published those fixes yet. I'll look into that.

The time zones are another issue. I convert everything to UTC. But I have started to think that this doesn't make so much sense. What we want is local time zone, we don't want to compare absolute times with each other or convert to different time zones. So I think I will change everything to timestamps that are in local time and not time zone aware.

@martin-ueding
Copy link
Owner

Done in 0.19.0.

@Oi-sin
Copy link
Author

Oi-sin commented Feb 5, 2024

I just updated to the newest github commit and get the following error with Strava API import

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\<user>\geo-activity-playground\geo_activity_playground\__main__.py", line 97, in main
    options.func(options)
  File "C:\Users\<user>\geo-activity-playground\geo_activity_playground\__main__.py", line 71, in <lambda>
    make_activity_repository(options.basedir, options.skip_strava),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<user>\geo-activity-playground\geo_activity_playground\__main__.py", line 114, in make_activity_repository
    import_from_strava_api(repository)
  File "C:\Users\<user>\geo-activity-playground\geo_activity_playground\importers\strava_api.py", line 96, in import_from_strava_api
    while try_import_strava(repository):
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<user>\geo-activity-playground\geo_activity_playground\importers\strava_api.py", line 141, in try_import_strava
    time_series = download_strava_time_series(activity.id, client)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<user>\geo-activity-playground\geo_activity_playground\importers\strava_api.py", line 194, in download_strava_time_series
    columns["distance_km"] = streams["distance"].data / 1000
                             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
TypeError: unsupported operand type(s) for /: 'list' and 'int'

@martin-ueding
Copy link
Owner

Version 0.20.0 is released you can update and try it out. If the issue persists, please reopen this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants