geo-activity-playground 0.26.1__py3-none-any.whl → 0.26.3__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/core/enrichment.py +11 -1
- geo_activity_playground/importers/strava_checkout.py +6 -4
- geo_activity_playground/webui/app.py +9 -3
- geo_activity_playground/webui/summary/controller.py +7 -6
- geo_activity_playground/webui/templates/page.html.j2 +6 -2
- {geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/METADATA +2 -2
- {geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/RECORD +10 -10
- {geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/LICENSE +0 -0
- {geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/WHEEL +0 -0
- {geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/entry_points.txt +0 -0
@@ -47,7 +47,17 @@ def enrich_activities(kind_defaults: dict[dict[str, Any]]) -> None:
|
|
47
47
|
or enriched_metadata_path.stat().st_mtime
|
48
48
|
< extracted_metadata_path.stat().st_mtime
|
49
49
|
):
|
50
|
-
|
50
|
+
extracted_time_series_path = (
|
51
|
+
activity_extracted_time_series_dir()
|
52
|
+
/ f"{extracted_metadata_path.stem}.parquet"
|
53
|
+
)
|
54
|
+
if extracted_time_series_path.exists():
|
55
|
+
new_extracted_metadata_paths.append(extracted_metadata_path)
|
56
|
+
else:
|
57
|
+
logger.error(
|
58
|
+
f"Extracted activity metadata {extracted_metadata_path} is lacking the corresponding time series path {extracted_time_series_path}. Likely that is an activity without location data. Deleting this."
|
59
|
+
)
|
60
|
+
extracted_metadata_path.unlink()
|
51
61
|
|
52
62
|
for extracted_metadata_path in tqdm(
|
53
63
|
new_extracted_metadata_paths, desc="Enrich new activity data"
|
@@ -190,11 +190,10 @@ def import_from_strava_checkout() -> None:
|
|
190
190
|
dateutil.parser.parse(row["Activity Date"], dayfirst=dayfirst)
|
191
191
|
),
|
192
192
|
}
|
193
|
-
meta_path = activity_extracted_meta_dir() / f"{activity_id}.pickle"
|
194
|
-
with open(meta_path, "wb") as f:
|
195
|
-
pickle.dump(table_activity_meta, f)
|
196
193
|
|
197
|
-
time_series_path =
|
194
|
+
time_series_path = (
|
195
|
+
activity_extracted_time_series_dir() / f"{activity_id}.parquet"
|
196
|
+
)
|
198
197
|
if time_series_path.exists():
|
199
198
|
time_series = pd.read_parquet(time_series_path)
|
200
199
|
else:
|
@@ -216,6 +215,9 @@ def import_from_strava_checkout() -> None:
|
|
216
215
|
if "latitude" not in time_series.columns:
|
217
216
|
continue
|
218
217
|
|
218
|
+
meta_path = activity_extracted_meta_dir() / f"{activity_id}.pickle"
|
219
|
+
with open(meta_path, "wb") as f:
|
220
|
+
pickle.dump(table_activity_meta, f)
|
219
221
|
time_series.to_parquet(time_series_path)
|
220
222
|
work_tracker.close()
|
221
223
|
|
@@ -1,9 +1,9 @@
|
|
1
|
+
import importlib
|
1
2
|
import json
|
2
3
|
import pathlib
|
3
4
|
import secrets
|
4
5
|
|
5
6
|
from flask import Flask
|
6
|
-
from flask import redirect
|
7
7
|
from flask import render_template
|
8
8
|
from flask import request
|
9
9
|
|
@@ -23,7 +23,6 @@ from .summary.blueprint import make_summary_blueprint
|
|
23
23
|
from .tile.blueprint import make_tile_blueprint
|
24
24
|
from .upload.blueprint import make_upload_blueprint
|
25
25
|
from geo_activity_playground.core.privacy_zones import PrivacyZone
|
26
|
-
from geo_activity_playground.webui.strava.controller import StravaController
|
27
26
|
|
28
27
|
|
29
28
|
def route_search(app: Flask, repository: ActivityRepository) -> None:
|
@@ -47,7 +46,7 @@ def route_start(app: Flask, repository: ActivityRepository) -> None:
|
|
47
46
|
|
48
47
|
|
49
48
|
def route_settings(app: Flask) -> None:
|
50
|
-
@app.route("/settings")
|
49
|
+
@app.route("/settings/")
|
51
50
|
def settings():
|
52
51
|
return render_template("settings.html.j2")
|
53
52
|
|
@@ -122,4 +121,11 @@ def webui_main(
|
|
122
121
|
url_prefix="/upload",
|
123
122
|
)
|
124
123
|
|
124
|
+
@app.context_processor
|
125
|
+
def inject_global_variables() -> dict:
|
126
|
+
return {
|
127
|
+
"version": importlib.metadata.version("geo-activity-playground"),
|
128
|
+
"num_activities": len(repository),
|
129
|
+
}
|
130
|
+
|
125
131
|
app.run(host=host, port=port)
|
@@ -61,11 +61,11 @@ def nominate_activities(meta: pd.DataFrame) -> dict[int, list[str]]:
|
|
61
61
|
i = subset["elapsed_time"].idxmax()
|
62
62
|
nominations[i].append(f"Longest elapsed time: {meta.loc[i].elapsed_time}")
|
63
63
|
|
64
|
-
if "calories" in subset.columns:
|
64
|
+
if "calories" in subset.columns and not pd.isna(subset["calories"]).all():
|
65
65
|
i = subset["calories"].idxmax()
|
66
66
|
nominations[i].append(f"Most calories burnt: {meta.loc[i].calories:.0f} kcal")
|
67
67
|
|
68
|
-
if "steps" in subset:
|
68
|
+
if "steps" in subset.columns and not pd.isna(subset["steps"]).all():
|
69
69
|
i = subset["steps"].idxmax()
|
70
70
|
nominations[i].append(f"Most steps: {meta.loc[i].steps:.0f}")
|
71
71
|
|
@@ -87,15 +87,16 @@ def nominate_activities(meta: pd.DataFrame) -> dict[int, list[str]]:
|
|
87
87
|
]:
|
88
88
|
if key in group.columns:
|
89
89
|
series = group[key]
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
if not pd.isna(series).all():
|
91
|
+
i = series.idxmax()
|
92
|
+
if not pd.isna(i):
|
93
|
+
nominations[i].append(text(meta.loc[i]))
|
93
94
|
|
94
95
|
return nominations
|
95
96
|
|
96
97
|
|
97
98
|
def embellished_activities(meta: pd.DataFrame) -> pd.DataFrame:
|
98
|
-
df = meta.copy()
|
99
|
+
df = meta.loc[~pd.isna(meta["start"])].copy()
|
99
100
|
df["year"] = [start.year for start in df["start"]]
|
100
101
|
df["month"] = [start.month for start in df["start"]]
|
101
102
|
df["day"] = [start.day for start in df["start"]]
|
@@ -60,7 +60,7 @@
|
|
60
60
|
</button>
|
61
61
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
62
62
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
63
|
-
|
63
|
+
{% if num_activities > 0 %}
|
64
64
|
<li class="nav-item">
|
65
65
|
<a class="nav-link" aria-current="page" href="{{ url_for('summary.index') }}">Summary</a>
|
66
66
|
</li>
|
@@ -86,6 +86,7 @@
|
|
86
86
|
<a class="nav-link" aria-current="page"
|
87
87
|
href="{{ url_for('equipment.index') }}">Equipment</a>
|
88
88
|
</li>
|
89
|
+
{% endif %}
|
89
90
|
<li class="nav-item">
|
90
91
|
<a class="nav-link" aria-current="page" href="{{ url_for('upload.index') }}">Upload</a>
|
91
92
|
</li>
|
@@ -155,7 +156,10 @@
|
|
155
156
|
{% endblock %}
|
156
157
|
|
157
158
|
<div class="row border-top py-3 my-4">
|
158
|
-
<ul class="nav col-
|
159
|
+
<ul class="nav col-4">
|
160
|
+
<li class="nav-item text-muted px-2 nav-link">Version {{ version }}</li>
|
161
|
+
</ul>
|
162
|
+
<ul class="nav col-8 justify-content-end">
|
159
163
|
<li class="nav-item"><a href="https://github.com/martin-ueding/geo-activity-playground"
|
160
164
|
class="nav-link px-2 text-muted" target="_blank">GitHub</a></li>
|
161
165
|
<li class="nav-item"><a href="https://martin-ueding.github.io/geo-activity-playground/"
|
{geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: geo-activity-playground
|
3
|
-
Version: 0.26.
|
3
|
+
Version: 0.26.3
|
4
4
|
Summary: Analysis of geo data activities like rides, runs or hikes.
|
5
5
|
License: MIT
|
6
6
|
Author: Martin Ueding
|
@@ -24,7 +24,7 @@ Requires-Dist: gpxpy (>=1.5.0,<2.0.0)
|
|
24
24
|
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
|
25
25
|
Requires-Dist: matplotlib (>=3.6.3,<4.0.0)
|
26
26
|
Requires-Dist: numpy (>=1.22.4,<2.0.0)
|
27
|
-
Requires-Dist: pandas (>=2.
|
27
|
+
Requires-Dist: pandas (>=2.2,<3.0)
|
28
28
|
Requires-Dist: pyarrow (>=16.1.0,<17.0.0)
|
29
29
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
30
30
|
Requires-Dist: requests (>=2.28.1,<3.0.0)
|
{geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/RECORD
RENAMED
@@ -4,7 +4,7 @@ geo_activity_playground/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
4
4
|
geo_activity_playground/core/activities.py,sha256=I1lsn1gO_P9eHbZCZlkCO6Lvi5sqXq_-c-1aDv6uKMs,8081
|
5
5
|
geo_activity_playground/core/config.py,sha256=YjqCiEmIAa-GM1-JfBctMEsl8-I56pZyyDdTyPduOzw,477
|
6
6
|
geo_activity_playground/core/coordinates.py,sha256=tDfr9mlXhK6E_MMIJ0vYWVCoH0Lq8uyuaqUgaa8i0jg,966
|
7
|
-
geo_activity_playground/core/enrichment.py,sha256=
|
7
|
+
geo_activity_playground/core/enrichment.py,sha256=CIkUS_wtLJ8ZLwtzxsZ8gRn8mkITLwIwq3AzTxZ-kzI,6994
|
8
8
|
geo_activity_playground/core/heatmap.py,sha256=bRLQHzmTEsQbX8XWeg85x_lRGk272UoYRiCnoxZ5da0,4189
|
9
9
|
geo_activity_playground/core/paths.py,sha256=ohJN_xNLh303uc0ATpL4iH01xANIE86pILRaQi4e-RQ,1893
|
10
10
|
geo_activity_playground/core/privacy_zones.py,sha256=4TumHsVUN1uW6RG3ArqTXDykPVipF98DCxVBe7YNdO8,512
|
@@ -22,7 +22,7 @@ geo_activity_playground/importers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
22
22
|
geo_activity_playground/importers/activity_parsers.py,sha256=m2SpvGlTZ8F3gG6YB24_ZFrlOAbtqbfWi-GIYspeUco,10593
|
23
23
|
geo_activity_playground/importers/directory.py,sha256=YTYuroH-oYviL2a9B7No-6Fx4RrkhMqf60Yh-7dGats,5384
|
24
24
|
geo_activity_playground/importers/strava_api.py,sha256=ihy_ezq_gYUy1V4jbtg41N6K0ilYVOEiPZE07lSiUHU,8444
|
25
|
-
geo_activity_playground/importers/strava_checkout.py,sha256=
|
25
|
+
geo_activity_playground/importers/strava_checkout.py,sha256=gOmqwDJE2kP6KFwxJ8_zGn5kcEcRqnfOqw8jJ4eHcaU,8596
|
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
|
@@ -33,7 +33,7 @@ geo_activity_playground/webui/activity/templates/activity/day.html.j2,sha256=r3q
|
|
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
35
|
geo_activity_playground/webui/activity/templates/activity/show.html.j2,sha256=NOsMPUBy1UQM_YebtT6RQxLSgSGvCMetqi_mspJmUjQ,5229
|
36
|
-
geo_activity_playground/webui/app.py,sha256=
|
36
|
+
geo_activity_playground/webui/app.py,sha256=h8yc6Ls7ozE7IblCM6TFs30t6J7FoTeWATLWwp_UVQc,4117
|
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
|
@@ -80,10 +80,10 @@ geo_activity_playground/webui/strava/templates/strava/client-id.html.j2,sha256=m
|
|
80
80
|
geo_activity_playground/webui/strava/templates/strava/connected.html.j2,sha256=TN6H8YPjG2zk8fodTaSaloTEJCXnpgTCIRX_uEVTiNI,274
|
81
81
|
geo_activity_playground/webui/summary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
82
82
|
geo_activity_playground/webui/summary/blueprint.py,sha256=kzQ6MDOycQKfDcVoEUmL7HYHJA_gu8DlzVHwO37-_jA,514
|
83
|
-
geo_activity_playground/webui/summary/controller.py,sha256=
|
83
|
+
geo_activity_playground/webui/summary/controller.py,sha256=ZOrwfrKjpc8hecUYImBvesKXZi06obfR1yhQkVTeWzw,8981
|
84
84
|
geo_activity_playground/webui/summary/templates/summary/index.html.j2,sha256=rsII1eMY-xNugh8A9SecnEcDZqkEOWYIfiHAGroQYuM,4442
|
85
85
|
geo_activity_playground/webui/templates/home.html.j2,sha256=fp48MjBuO4QJfQz6YPOWH56IzStgaclx9XbwEKmUFHQ,2403
|
86
|
-
geo_activity_playground/webui/templates/page.html.j2,sha256=
|
86
|
+
geo_activity_playground/webui/templates/page.html.j2,sha256=RyB-G2dhdhTUSwXAxquylk2ma3DXMZ490g6yrgsxA-I,9388
|
87
87
|
geo_activity_playground/webui/templates/search.html.j2,sha256=FvNRoDfUlSzXjM_tqZY_fDhuhUDgbPaY73q56gdvF1A,1130
|
88
88
|
geo_activity_playground/webui/templates/settings.html.j2,sha256=-q9GflrG2t6kSt-NerBN5NV1gRp12JT3KgGp_aPaKT8,674
|
89
89
|
geo_activity_playground/webui/tile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -93,8 +93,8 @@ geo_activity_playground/webui/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
93
93
|
geo_activity_playground/webui/upload/blueprint.py,sha256=2l5q1LYtjgLF_3CAyPvCLx-wMebp14OJvgZBzGILdmQ,801
|
94
94
|
geo_activity_playground/webui/upload/controller.py,sha256=BWcSlLy_fVAodDlnXkxE4eIotC_UHrjldACrToA-iAQ,3975
|
95
95
|
geo_activity_playground/webui/upload/templates/upload/index.html.j2,sha256=hfXkEXaz_MkM46rU56423D6V6WtK-EAXPszSY-_-Tx8,1471
|
96
|
-
geo_activity_playground-0.26.
|
97
|
-
geo_activity_playground-0.26.
|
98
|
-
geo_activity_playground-0.26.
|
99
|
-
geo_activity_playground-0.26.
|
100
|
-
geo_activity_playground-0.26.
|
96
|
+
geo_activity_playground-0.26.3.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
|
97
|
+
geo_activity_playground-0.26.3.dist-info/METADATA,sha256=9v9y9sR7bMNsUoFDrYQC9d-YQ0VL0UDVHhM6RY4I0iA,1665
|
98
|
+
geo_activity_playground-0.26.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
99
|
+
geo_activity_playground-0.26.3.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
|
100
|
+
geo_activity_playground-0.26.3.dist-info/RECORD,,
|
{geo_activity_playground-0.26.1.dist-info → geo_activity_playground-0.26.3.dist-info}/LICENSE
RENAMED
File without changes
|
File without changes
|
File without changes
|