geo-activity-playground 0.26.1__py3-none-any.whl → 0.26.2__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.
@@ -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
- i = series.idxmax()
91
- if not pd.isna(i):
92
- nominations[i].append(text(meta.loc[i]))
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-12 justify-content-end">
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/"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geo-activity-playground
3
- Version: 0.26.1
3
+ Version: 0.26.2
4
4
  Summary: Analysis of geo data activities like rides, runs or hikes.
5
5
  License: MIT
6
6
  Author: Martin Ueding
@@ -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=a6RcsPH-n1Ru6RybkAPCRENL9KnPvxfPBJI9IzsEB5U,3980
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=i6A9-S9j9Hm67FcZPzJpqMgxRVsXbDmJiVLGiRtZIqk,8805
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=KwgUw7zOjWNVSZKM4BGWOaBbPhGZaaOXCvNV9pL-0R4,9160
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.1.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
97
- geo_activity_playground-0.26.1.dist-info/METADATA,sha256=jEJ07iHCszCGv_rGgRgCtdevF-2D10KeakN-5eNRARA,1665
98
- geo_activity_playground-0.26.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
99
- geo_activity_playground-0.26.1.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
100
- geo_activity_playground-0.26.1.dist-info/RECORD,,
96
+ geo_activity_playground-0.26.2.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
97
+ geo_activity_playground-0.26.2.dist-info/METADATA,sha256=Ot8-TBu04cUSoZHJPa3UuzX1-b2RwcN3kAfK4ykTaHw,1665
98
+ geo_activity_playground-0.26.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
99
+ geo_activity_playground-0.26.2.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
100
+ geo_activity_playground-0.26.2.dist-info/RECORD,,