martin-ueding / geo-activity-playground

Data analysis and visualization based on GPS tracked outdoor activities.
https://martin-ueding.github.io/geo-activity-playground/
MIT License
30 stars 12 forks source link

Datentyp der Zeitstempel bei Strava #122

Closed jottojott closed 1 month ago

jottojott commented 2 months ago

Hallo Martin! GeoActivityPlayground stürzt beim Abruf von Strava ab ( vgl. https://nrw.social/@Jochen_Jansen/112761168027657327 )

jochen@T570:~$ geo-activity-playground --basedir ~/Dokumente/Apps/Playground serve
2024-07-10 11:24:39 geo_activity_playground.core.cache_migrations INFO Apply cache migration if needed …
Parse activity metadata: 0it [00:00, ?it/s]
Collate activity metadata: 0it [00:00, ?it/s]
Downloading Strava activities: 3it [00:00,  3.42it/s]
Traceback (most recent call last):
  File "/home/jochen/.local/bin/geo-activity-playground", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/__main__.py", line 93, in main
    options.func(options)
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/__main__.py", line 67, in <lambda>
    *make_activity_repository(options.basedir, options.skip_strava),
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/__main__.py", line 112, in make_activity_repository
    scan_for_activities(repository, tile_visit_accessor, config, skip_strava)
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/webui/upload_controller.py", line 104, in scan_for_activities
    import_from_strava_api(repository)
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/importers/strava_api.py", line 96, in import_from_strava_api
    while try_import_strava(repository):
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/importers/strava_api.py", line 177, in try_import_strava
    repository.commit()
  File "/home/jochen/.local/pipx/venvs/geo-activity-playground/lib/python3.11/site-packages/geo_activity_playground/core/activities.py", line 95, in commit
    assert pd.api.types.is_dtype_equal(
AssertionError: (dtype('O'), Timestamp('2021-01-31 12:54:35.488000+0000', tz='UTC'))
martin-ueding commented 1 month ago

Die Sache mit den Zeitzonen nervt mich echt ungemein, irgendwie werde ich das Problem nicht los. Ich habe jetzt alle Zeitzonen entfernt und arbeite nur noch mit "timezone naive" Daten. Das dürfte auch letztlich dem entsprechen, was man in der Analyse möchte, schließlich ist das immer in der lokalen Zeitzone relevant.

Ich habe gerade keinen Strava-Account zum Testen. Es könnte also sein, dass es noch immer nicht geht. Du kannst mal die Version 0.24 ausprobieren, die ich gleich hochlade.

martin-ueding commented 1 month ago

Ich habe es jetzt mit einem neuen Strava-Account ausprobiert. Sollte dann in der nächsten Version behoben sein.