geo-activity-playground 0.24.1__py3-none-any.whl → 0.25.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geo_activity_playground/__main__.py +0 -2
- geo_activity_playground/core/activities.py +71 -149
- geo_activity_playground/core/enrichment.py +164 -0
- geo_activity_playground/core/paths.py +34 -15
- geo_activity_playground/core/tasks.py +26 -3
- geo_activity_playground/explorer/tile_visits.py +78 -42
- geo_activity_playground/{core → importers}/activity_parsers.py +7 -14
- geo_activity_playground/importers/directory.py +36 -27
- geo_activity_playground/importers/strava_api.py +45 -38
- geo_activity_playground/importers/strava_checkout.py +24 -16
- geo_activity_playground/webui/activity/controller.py +2 -2
- geo_activity_playground/webui/activity/templates/activity/show.html.j2 +2 -0
- geo_activity_playground/webui/app.py +11 -31
- geo_activity_playground/webui/entry_controller.py +5 -5
- geo_activity_playground/webui/equipment/controller.py +80 -39
- geo_activity_playground/webui/equipment/templates/equipment/index.html.j2 +14 -3
- geo_activity_playground/webui/heatmap/heatmap_controller.py +6 -0
- geo_activity_playground/webui/strava/__init__.py +0 -0
- geo_activity_playground/webui/strava/blueprint.py +33 -0
- geo_activity_playground/webui/strava/controller.py +47 -0
- geo_activity_playground/webui/{templates/strava-connect.html.j2 → strava/templates/strava/client-id.html.j2} +3 -7
- geo_activity_playground/webui/strava/templates/strava/connected.html.j2 +14 -0
- geo_activity_playground/webui/summary/controller.py +11 -8
- geo_activity_playground/webui/templates/home.html.j2 +5 -0
- geo_activity_playground/webui/templates/page.html.j2 +3 -0
- geo_activity_playground/webui/templates/settings.html.j2 +15 -0
- geo_activity_playground/webui/upload/controller.py +12 -16
- {geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/METADATA +1 -1
- {geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/RECORD +32 -28
- geo_activity_playground/core/cache_migrations.py +0 -133
- geo_activity_playground/webui/strava_controller.py +0 -27
- {geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/LICENSE +0 -0
- {geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/WHEEL +0 -0
- {geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/entry_points.txt +0 -0
{geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/RECORD
RENAMED
@@ -1,39 +1,39 @@
|
|
1
1
|
geo_activity_playground/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
geo_activity_playground/__main__.py,sha256=
|
2
|
+
geo_activity_playground/__main__.py,sha256=NQDFaa1BSIdare1oIdYO0cESf0kPVnEIE3J24jlsX_E,4021
|
3
3
|
geo_activity_playground/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
geo_activity_playground/core/activities.py,sha256=
|
5
|
-
geo_activity_playground/core/activity_parsers.py,sha256=pjYjnaAXsWfUNOoomYWOmmFZO5Qs076RWM-pqNdo7BA,10905
|
6
|
-
geo_activity_playground/core/cache_migrations.py,sha256=tkGA0h69-m-0Ek7JjvfVOX45YXLXkh_ZvC2TKB_fvbA,4281
|
4
|
+
geo_activity_playground/core/activities.py,sha256=I1lsn1gO_P9eHbZCZlkCO6Lvi5sqXq_-c-1aDv6uKMs,8081
|
7
5
|
geo_activity_playground/core/config.py,sha256=YjqCiEmIAa-GM1-JfBctMEsl8-I56pZyyDdTyPduOzw,477
|
8
6
|
geo_activity_playground/core/coordinates.py,sha256=tDfr9mlXhK6E_MMIJ0vYWVCoH0Lq8uyuaqUgaa8i0jg,966
|
7
|
+
geo_activity_playground/core/enrichment.py,sha256=wRVhrUCsvs2CcVhN-BQwxk_W_0E0AFp1_hncGzWNNvo,6435
|
9
8
|
geo_activity_playground/core/heatmap.py,sha256=bRLQHzmTEsQbX8XWeg85x_lRGk272UoYRiCnoxZ5da0,4189
|
10
|
-
geo_activity_playground/core/paths.py,sha256=
|
9
|
+
geo_activity_playground/core/paths.py,sha256=ohJN_xNLh303uc0ATpL4iH01xANIE86pILRaQi4e-RQ,1893
|
11
10
|
geo_activity_playground/core/privacy_zones.py,sha256=4TumHsVUN1uW6RG3ArqTXDykPVipF98DCxVBe7YNdO8,512
|
12
11
|
geo_activity_playground/core/similarity.py,sha256=Jo8jRViuORCxdIGvyaflgsQhwu9S_jn10a450FRL18A,3159
|
13
|
-
geo_activity_playground/core/tasks.py,sha256=
|
12
|
+
geo_activity_playground/core/tasks.py,sha256=wp3Q8P0u9Frbuel1Inll6Zgi8a3GUM7SCltE14o1VXw,2495
|
14
13
|
geo_activity_playground/core/test_tiles.py,sha256=zce1FxNfsSpOQt66jMehdQRVoNdl-oiFydx6iVBHZXM,764
|
15
14
|
geo_activity_playground/core/test_time_conversion.py,sha256=Sh6nZA3uCTOdZTZa3yOijtR0m74QtZu2mcWXsDNnyQI,984
|
16
15
|
geo_activity_playground/core/tiles.py,sha256=VxPu9vdfKnxDxaYo5JSYmka9Dt3TDxg0zo3cYVJXVHc,3359
|
17
16
|
geo_activity_playground/core/time_conversion.py,sha256=9J6aTlqJhWvsknQkoECNL-CIG-8BKs6ZatJJ9XJnTsg,367
|
18
17
|
geo_activity_playground/explorer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
18
|
geo_activity_playground/explorer/grid_file.py,sha256=k6j6KBEk2a2BY-onE8SV5TJsERGGyOrlY4as__meWpA,3304
|
20
|
-
geo_activity_playground/explorer/tile_visits.py,sha256=
|
19
|
+
geo_activity_playground/explorer/tile_visits.py,sha256=CLZ8bCUKc5YoxvNa23hGF9JtlinIl9Wbk9u2xN4bJpw,13457
|
21
20
|
geo_activity_playground/explorer/video.py,sha256=ROAmV9shfJyqTgnXVD41KFORiwnRgVpEWenIq4hMCRM,4389
|
22
21
|
geo_activity_playground/importers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
-
geo_activity_playground/importers/
|
24
|
-
geo_activity_playground/importers/
|
25
|
-
geo_activity_playground/importers/
|
22
|
+
geo_activity_playground/importers/activity_parsers.py,sha256=m2SpvGlTZ8F3gG6YB24_ZFrlOAbtqbfWi-GIYspeUco,10593
|
23
|
+
geo_activity_playground/importers/directory.py,sha256=YTYuroH-oYviL2a9B7No-6Fx4RrkhMqf60Yh-7dGats,5384
|
24
|
+
geo_activity_playground/importers/strava_api.py,sha256=ihy_ezq_gYUy1V4jbtg41N6K0ilYVOEiPZE07lSiUHU,8444
|
25
|
+
geo_activity_playground/importers/strava_checkout.py,sha256=mUKfCzBk0sMF6WEmAGelnwqGnonVO1UW_uZVAtxDJVQ,8576
|
26
26
|
geo_activity_playground/importers/test_directory.py,sha256=ljXokx7q0OgtHvEdHftcQYEmZJUDVv3OOF5opklxdT4,724
|
27
27
|
geo_activity_playground/importers/test_strava_api.py,sha256=4vX7wDr1a9aRh8myxNrIq6RwDBbP8ZeoXXPc10CAbW4,431
|
28
28
|
geo_activity_playground/webui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
29
|
geo_activity_playground/webui/activity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
geo_activity_playground/webui/activity/blueprint.py,sha256=gGMes5ycXi2rMixVYs4NQgzTU1Vttgu50prYAe3--Hs,1749
|
31
|
-
geo_activity_playground/webui/activity/controller.py,sha256=
|
31
|
+
geo_activity_playground/webui/activity/controller.py,sha256=BSmHwO2GLyMGiFRQ0BpTsHMKDWJbz5UHnwQ9HVULN4c,16679
|
32
32
|
geo_activity_playground/webui/activity/templates/activity/day.html.j2,sha256=r3qKl9uTzOko4R-ZzyYAZt1j61JSevYP4g0Yi06HHPg,2702
|
33
33
|
geo_activity_playground/webui/activity/templates/activity/lines.html.j2,sha256=5gB1aDjRgi_RventenRfC10_FtMT4ch_VuWvA9AMlBY,1121
|
34
34
|
geo_activity_playground/webui/activity/templates/activity/name.html.j2,sha256=RDLEt6ip8_ngmdLgaC5jg92Dk-F2umGwKkd8cWmvVko,2400
|
35
|
-
geo_activity_playground/webui/activity/templates/activity/show.html.j2,sha256=
|
36
|
-
geo_activity_playground/webui/app.py,sha256=
|
35
|
+
geo_activity_playground/webui/activity/templates/activity/show.html.j2,sha256=NOsMPUBy1UQM_YebtT6RQxLSgSGvCMetqi_mspJmUjQ,5229
|
36
|
+
geo_activity_playground/webui/app.py,sha256=a6RcsPH-n1Ru6RybkAPCRENL9KnPvxfPBJI9IzsEB5U,3980
|
37
37
|
geo_activity_playground/webui/calendar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
38
|
geo_activity_playground/webui/calendar/blueprint.py,sha256=rlnhgU2DWAcdLMRq7m77NzrM_aDyp4s3kuuQHuzjHhg,782
|
39
39
|
geo_activity_playground/webui/calendar/controller.py,sha256=QpSAkR2s1sbLSu6P_fNNTccgGglOzEH2PIv1XwKxeVY,2778
|
@@ -43,18 +43,18 @@ geo_activity_playground/webui/eddington/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
43
43
|
geo_activity_playground/webui/eddington/blueprint.py,sha256=evIvueLfDWVTxJ9pRguqmZ9-Pybd2WmBRst_-7vX2QA,551
|
44
44
|
geo_activity_playground/webui/eddington/controller.py,sha256=L4YssL088UMamp4qgzEtilzhaKGZsyfVUScuw-fmTjE,2888
|
45
45
|
geo_activity_playground/webui/eddington/templates/eddington/index.html.j2,sha256=XHKeUymQMS5x00PLOVlg-nSRCz_jHB2pvD8QunULWJ4,1839
|
46
|
-
geo_activity_playground/webui/entry_controller.py,sha256=
|
46
|
+
geo_activity_playground/webui/entry_controller.py,sha256=n9v4MriyL8kDR91LE9eeqc2tAvxyzFgoNMMXpr0qh4g,1906
|
47
47
|
geo_activity_playground/webui/equipment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
48
|
geo_activity_playground/webui/equipment/blueprint.py,sha256=YbOAsjk05BMeUlD6wGfxE1amvlLsFjG4HMJn5SBrVRU,551
|
49
|
-
geo_activity_playground/webui/equipment/controller.py,sha256=
|
50
|
-
geo_activity_playground/webui/equipment/templates/equipment/index.html.j2,sha256=
|
49
|
+
geo_activity_playground/webui/equipment/controller.py,sha256=m1LNaGCNJnW97TlKT6x9NfQcMp6RKcZ8Q0I1FTUAvss,4037
|
50
|
+
geo_activity_playground/webui/equipment/templates/equipment/index.html.j2,sha256=FEfxB4XwVYELAOdjVlSlprjJH_kLmE-pNWEEXdPqc6I,1778
|
51
51
|
geo_activity_playground/webui/explorer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
52
|
geo_activity_playground/webui/explorer/blueprint.py,sha256=jHE6bb4H2GmYaix9P452Cyrn_30z_Nm705AZ0WNm4HQ,1950
|
53
53
|
geo_activity_playground/webui/explorer/controller.py,sha256=8d0FFrG55ZlPQ5seQC2DegxIkPGIW7pvw8Jm4eJt3fg,10634
|
54
54
|
geo_activity_playground/webui/explorer/templates/explorer/index.html.j2,sha256=OxNt2_VwH-cmVXJrDNfeD-dNB9IrwBjdhhQEqkXxHj0,6529
|
55
55
|
geo_activity_playground/webui/heatmap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
56
56
|
geo_activity_playground/webui/heatmap/blueprint.py,sha256=bjQu-HL3QN5UpJ6tHOifhcLGlPr_hIKvaRu78md4JqM,1470
|
57
|
-
geo_activity_playground/webui/heatmap/heatmap_controller.py,sha256=
|
57
|
+
geo_activity_playground/webui/heatmap/heatmap_controller.py,sha256=i376qEqTJrhezGsdPyKR8VsRY2N0JdEra7_kY7NmwW8,6822
|
58
58
|
geo_activity_playground/webui/heatmap/templates/heatmap/index.html.j2,sha256=YLeu6P4djl8G4qAXR6DhetseqrbOodN7aN4coocknc4,1875
|
59
59
|
geo_activity_playground/webui/search_controller.py,sha256=PzMf7b8tiJKZIZoPvQ9A2hOrzoKV9cS3jq05w2fK94c,532
|
60
60
|
geo_activity_playground/webui/square_planner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -72,24 +72,28 @@ geo_activity_playground/webui/static/favicon.ico,sha256=uVNZlrF22zn1lcCS_9wAoWLh
|
|
72
72
|
geo_activity_playground/webui/static/mstile-150x150.png,sha256=j1ANUQJ1Xi1DR2sGqYZztob2ypfGw04eNtGpN9SxExA,11964
|
73
73
|
geo_activity_playground/webui/static/safari-pinned-tab.svg,sha256=OzoEVGY0igWRXM1NiM3SRKugdICBN7aB_XuxaC3Mu9Q,8371
|
74
74
|
geo_activity_playground/webui/static/site.webmanifest,sha256=4vYxdPMpwTdB8EmOvHkkYcjZ8Yrci3pOwwY3o_VwACA,440
|
75
|
-
geo_activity_playground/webui/
|
75
|
+
geo_activity_playground/webui/strava/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
76
|
+
geo_activity_playground/webui/strava/blueprint.py,sha256=Q2Wfxlg7bR2vjWZ3UpckPl9jWHwNB8hfP7SLBufgiUY,1055
|
77
|
+
geo_activity_playground/webui/strava/controller.py,sha256=vTspMZvhM2jt3PjnN4ey17mSRvbeoHktZ5_r9mxyfZY,1379
|
78
|
+
geo_activity_playground/webui/strava/templates/strava/client-id.html.j2,sha256=fnxr1pSZgLxrdykqy33fYqoo8jVvdWSXBj8ZDIXq_jw,849
|
79
|
+
geo_activity_playground/webui/strava/templates/strava/connected.html.j2,sha256=e0FB00AwxuKWDsENkSq6FW-822-gx1ubNMps-Sj5gsY,279
|
76
80
|
geo_activity_playground/webui/summary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
77
81
|
geo_activity_playground/webui/summary/blueprint.py,sha256=kzQ6MDOycQKfDcVoEUmL7HYHJA_gu8DlzVHwO37-_jA,514
|
78
|
-
geo_activity_playground/webui/summary/controller.py,sha256=
|
82
|
+
geo_activity_playground/webui/summary/controller.py,sha256=i6A9-S9j9Hm67FcZPzJpqMgxRVsXbDmJiVLGiRtZIqk,8805
|
79
83
|
geo_activity_playground/webui/summary/templates/summary/index.html.j2,sha256=rsII1eMY-xNugh8A9SecnEcDZqkEOWYIfiHAGroQYuM,4442
|
80
|
-
geo_activity_playground/webui/templates/home.html.j2,sha256=
|
81
|
-
geo_activity_playground/webui/templates/page.html.j2,sha256=
|
84
|
+
geo_activity_playground/webui/templates/home.html.j2,sha256=fp48MjBuO4QJfQz6YPOWH56IzStgaclx9XbwEKmUFHQ,2403
|
85
|
+
geo_activity_playground/webui/templates/page.html.j2,sha256=Dal68Juf6dZeejnG79mESfyLX_cweFXMSmLF4J1Ybk4,7489
|
82
86
|
geo_activity_playground/webui/templates/search.html.j2,sha256=FvNRoDfUlSzXjM_tqZY_fDhuhUDgbPaY73q56gdvF1A,1130
|
83
|
-
geo_activity_playground/webui/templates/
|
87
|
+
geo_activity_playground/webui/templates/settings.html.j2,sha256=HSFmNameF7ejSd5PxGVuPNBV5HgjP61Q7th8ZR0AxOU,297
|
84
88
|
geo_activity_playground/webui/tile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
89
|
geo_activity_playground/webui/tile/blueprint.py,sha256=cK0o2Z3BrLycgF9zw0F8s9qF-JaYDbF5Gog-GXDtUZ8,943
|
86
90
|
geo_activity_playground/webui/tile/controller.py,sha256=PISh4vKs27b-LxFfTARtr5RAwHFresA1Kw1MDcERSRU,1221
|
87
91
|
geo_activity_playground/webui/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
88
92
|
geo_activity_playground/webui/upload/blueprint.py,sha256=2l5q1LYtjgLF_3CAyPvCLx-wMebp14OJvgZBzGILdmQ,801
|
89
|
-
geo_activity_playground/webui/upload/controller.py,sha256=
|
93
|
+
geo_activity_playground/webui/upload/controller.py,sha256=FDqhCPUpK5uQMfu1xGZ19Sw7jeazL33btX0a8BV5sgo,3985
|
90
94
|
geo_activity_playground/webui/upload/templates/upload/index.html.j2,sha256=hfXkEXaz_MkM46rU56423D6V6WtK-EAXPszSY-_-Tx8,1471
|
91
|
-
geo_activity_playground-0.
|
92
|
-
geo_activity_playground-0.
|
93
|
-
geo_activity_playground-0.
|
94
|
-
geo_activity_playground-0.
|
95
|
-
geo_activity_playground-0.
|
95
|
+
geo_activity_playground-0.25.0.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
|
96
|
+
geo_activity_playground-0.25.0.dist-info/METADATA,sha256=d7EZsJfNeXv7cqVnCCJ_jOoxs5-a7Wlntgw7nZTrOKM,1665
|
97
|
+
geo_activity_playground-0.25.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
98
|
+
geo_activity_playground-0.25.0.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
|
99
|
+
geo_activity_playground-0.25.0.dist-info/RECORD,,
|
@@ -1,133 +0,0 @@
|
|
1
|
-
import json
|
2
|
-
import logging
|
3
|
-
import pathlib
|
4
|
-
import shutil
|
5
|
-
|
6
|
-
import pandas as pd
|
7
|
-
from tqdm import tqdm
|
8
|
-
|
9
|
-
from geo_activity_playground.core.paths import activities_path
|
10
|
-
from geo_activity_playground.core.paths import activity_timeseries_dir
|
11
|
-
from geo_activity_playground.core.tasks import work_tracker_path
|
12
|
-
|
13
|
-
logger = logging.getLogger(__name__)
|
14
|
-
|
15
|
-
|
16
|
-
def delete_activities_per_tile() -> None:
|
17
|
-
paths = [
|
18
|
-
pathlib.Path("Cache/activities-per-tile.pickle"),
|
19
|
-
pathlib.Path("Cache/activities-per-tile-task.json"),
|
20
|
-
]
|
21
|
-
for path in paths:
|
22
|
-
path.unlink(missing_ok=True)
|
23
|
-
|
24
|
-
|
25
|
-
def delete_work_tracker(name: str):
|
26
|
-
work_tracker_path(name).unlink(missing_ok=True)
|
27
|
-
|
28
|
-
|
29
|
-
def reset_time_series_embellishment() -> None:
|
30
|
-
pathlib.Path("Cache/work-tracker-embellish-time-series.pickle").unlink(
|
31
|
-
missing_ok=True
|
32
|
-
)
|
33
|
-
|
34
|
-
|
35
|
-
def delete_tile_visits() -> None:
|
36
|
-
paths = [
|
37
|
-
pathlib.Path("Cache/activities-per-tile.pickle"),
|
38
|
-
pathlib.Path("Cache/tile-evolution-state.pickle"),
|
39
|
-
pathlib.Path("Cache/tile-history.pickle"),
|
40
|
-
pathlib.Path("Cache/tile-visits.pickle"),
|
41
|
-
pathlib.Path("Cache/work-tracker-parse-activity-files.pickle"),
|
42
|
-
pathlib.Path("Cache/work-tracker-tile-visits.pickle"),
|
43
|
-
]
|
44
|
-
for path in paths:
|
45
|
-
path.unlink(missing_ok=True)
|
46
|
-
|
47
|
-
|
48
|
-
def delete_heatmap_cache() -> None:
|
49
|
-
path = pathlib.Path("Cache/Heatmap")
|
50
|
-
if path.exists():
|
51
|
-
shutil.rmtree(path)
|
52
|
-
|
53
|
-
|
54
|
-
def delete_activity_metadata() -> None:
|
55
|
-
delete_work_tracker("parse-activity-files")
|
56
|
-
activities_path().unlink(missing_ok=True)
|
57
|
-
|
58
|
-
|
59
|
-
def convert_distances_to_km() -> None:
|
60
|
-
if activities_path().exists():
|
61
|
-
activities = pd.read_parquet(activities_path())
|
62
|
-
if not "distance_km" in activities.columns:
|
63
|
-
activities["distance_km"] = activities["distance"] / 1000
|
64
|
-
for col in ["distance", "distance/km"]:
|
65
|
-
if col in activities.columns:
|
66
|
-
del activities[col]
|
67
|
-
activities.to_parquet(activities_path())
|
68
|
-
|
69
|
-
for time_series_path in tqdm(
|
70
|
-
list(activity_timeseries_dir().glob("*.parquet")),
|
71
|
-
desc="Convert m to km",
|
72
|
-
):
|
73
|
-
time_series = pd.read_parquet(time_series_path)
|
74
|
-
if "distance" in time_series.columns:
|
75
|
-
time_series["distance_km"] = time_series["distance"] / 1000
|
76
|
-
for col in ["distance", "distance/km"]:
|
77
|
-
if col in time_series.columns:
|
78
|
-
del time_series[col]
|
79
|
-
time_series.to_parquet(time_series_path)
|
80
|
-
|
81
|
-
|
82
|
-
def add_consider_for_achievements() -> None:
|
83
|
-
activities_path = pathlib.Path("Cache/activities.parquet")
|
84
|
-
if activities_path.exists():
|
85
|
-
df = pd.read_parquet(activities_path)
|
86
|
-
if "consider_for_achievements" not in df.columns:
|
87
|
-
df["consider_for_achievements"] = True
|
88
|
-
else:
|
89
|
-
df.loc[
|
90
|
-
df["consider_for_achievements"].isna(), "consider_for_achievements"
|
91
|
-
] = True
|
92
|
-
df.to_parquet("Cache/activities.parquet")
|
93
|
-
|
94
|
-
|
95
|
-
def delete_everything() -> None:
|
96
|
-
if pathlib.Path("Cache").exists():
|
97
|
-
shutil.rmtree("Cache")
|
98
|
-
|
99
|
-
|
100
|
-
def apply_cache_migrations() -> None:
|
101
|
-
logger.info("Apply cache migration if needed …")
|
102
|
-
cache_status_file = pathlib.Path("Cache/status.json")
|
103
|
-
if cache_status_file.exists():
|
104
|
-
with open(cache_status_file) as f:
|
105
|
-
cache_status = json.load(f)
|
106
|
-
else:
|
107
|
-
cache_status = {"num_applied_migrations": 0}
|
108
|
-
|
109
|
-
migrations = [
|
110
|
-
delete_activities_per_tile,
|
111
|
-
reset_time_series_embellishment,
|
112
|
-
delete_tile_visits,
|
113
|
-
delete_heatmap_cache,
|
114
|
-
delete_activity_metadata,
|
115
|
-
delete_activity_metadata,
|
116
|
-
convert_distances_to_km,
|
117
|
-
delete_activity_metadata,
|
118
|
-
delete_tile_visits,
|
119
|
-
delete_heatmap_cache,
|
120
|
-
add_consider_for_achievements,
|
121
|
-
delete_tile_visits,
|
122
|
-
delete_heatmap_cache,
|
123
|
-
delete_tile_visits,
|
124
|
-
delete_everything,
|
125
|
-
]
|
126
|
-
|
127
|
-
for migration in migrations[cache_status["num_applied_migrations"] :]:
|
128
|
-
logger.info(f"Applying cache migration {migration.__name__} …")
|
129
|
-
migration()
|
130
|
-
cache_status["num_applied_migrations"] += 1
|
131
|
-
cache_status_file.parent.mkdir(exist_ok=True, parents=True)
|
132
|
-
with open(cache_status_file, "w") as f:
|
133
|
-
json.dump(cache_status, f)
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import urllib.parse
|
2
|
-
from typing import Optional
|
3
|
-
|
4
|
-
|
5
|
-
class StravaController:
|
6
|
-
def __init__(self) -> None:
|
7
|
-
self._client_secret: Optional[str] = None
|
8
|
-
|
9
|
-
def action_connect(self) -> dict:
|
10
|
-
return {}
|
11
|
-
|
12
|
-
def action_authorize(
|
13
|
-
self, host: str, port: int, client_id: str, client_secret: str
|
14
|
-
) -> str:
|
15
|
-
self._client_secret = client_secret
|
16
|
-
|
17
|
-
payload = {
|
18
|
-
"client_id": client_id,
|
19
|
-
"redirect_uri": f"http://{host}:{port}/strava/callback",
|
20
|
-
"response_type": "code",
|
21
|
-
"scope": "activity:read_all",
|
22
|
-
}
|
23
|
-
|
24
|
-
arg_string = "&".join(
|
25
|
-
f"{key}={urllib.parse.quote(value)}" for key, value in payload.items()
|
26
|
-
)
|
27
|
-
return f"https://www.strava.com/oauth/authorize?{arg_string}"
|
{geo_activity_playground-0.24.1.dist-info → geo_activity_playground-0.25.0.dist-info}/LICENSE
RENAMED
File without changes
|
File without changes
|
File without changes
|