geo-activity-playground 1.3.1__py3-none-any.whl → 1.3.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.
- geo_activity_playground/core/copernicus_dem.py +9 -7
- geo_activity_playground/core/enrichment.py +3 -2
- geo_activity_playground/webui/blueprints/activity_blueprint.py +2 -2
- {geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/METADATA +3 -8
- {geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/RECORD +8 -8
- {geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/LICENSE +0 -0
- {geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/WHEEL +0 -0
- {geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/entry_points.txt +0 -0
@@ -13,7 +13,7 @@ from scipy.interpolate import RegularGridInterpolator
|
|
13
13
|
from .paths import USER_CACHE_DIR
|
14
14
|
|
15
15
|
|
16
|
-
def
|
16
|
+
def _s3_path(lat: int, lon: int) -> pathlib.Path:
|
17
17
|
lat_str = f"N{(lat):02d}" if lat >= 0 else f"S{(-lat):02d}"
|
18
18
|
lon_str = f"E{(lon):03d}" if lon >= 0 else f"W{(-lon):03d}"
|
19
19
|
result = (
|
@@ -26,7 +26,7 @@ def s3_path(lat: int, lon: int) -> pathlib.Path:
|
|
26
26
|
return result
|
27
27
|
|
28
28
|
|
29
|
-
def
|
29
|
+
def _ensure_copernicus_file(p: pathlib.Path) -> None:
|
30
30
|
if p.exists():
|
31
31
|
return
|
32
32
|
s3 = boto3.client(
|
@@ -39,10 +39,12 @@ def ensure_copernicus_file(p: pathlib.Path) -> None:
|
|
39
39
|
|
40
40
|
|
41
41
|
@functools.lru_cache(9)
|
42
|
-
def
|
43
|
-
|
42
|
+
def _get_elevation_arrays(p: pathlib.Path) -> Optional[np.ndarray]:
|
43
|
+
|
44
|
+
_ensure_copernicus_file(p)
|
44
45
|
if not p.exists():
|
45
46
|
return None
|
47
|
+
|
46
48
|
gt = geotiff.GeoTiff(p)
|
47
49
|
a = np.array(gt.read())
|
48
50
|
lon_array, lat_array = gt.get_coord_arrays()
|
@@ -50,8 +52,8 @@ def get_elevation_arrays(p: pathlib.Path) -> Optional[np.ndarray]:
|
|
50
52
|
|
51
53
|
|
52
54
|
@functools.lru_cache(1)
|
53
|
-
def
|
54
|
-
arrays =
|
55
|
+
def _get_interpolator(lat: int, lon: int) -> Optional[RegularGridInterpolator]:
|
56
|
+
arrays = _get_elevation_arrays(_s3_path(lat, lon))
|
55
57
|
# If we don't have data for the current center, we cannot do anything.
|
56
58
|
if arrays is None:
|
57
59
|
return None
|
@@ -88,7 +90,7 @@ def get_interpolator(lat: int, lon: int) -> Optional[RegularGridInterpolator]:
|
|
88
90
|
|
89
91
|
|
90
92
|
def get_elevation(lat: float, lon: float) -> float:
|
91
|
-
interpolator =
|
93
|
+
interpolator = _get_interpolator(math.floor(lat), math.floor(lon))
|
92
94
|
if interpolator is not None:
|
93
95
|
return float(interpolator((lat, lon)))
|
94
96
|
else:
|
@@ -9,7 +9,6 @@ import pandas as pd
|
|
9
9
|
|
10
10
|
from .config import Config
|
11
11
|
from .coordinates import get_distance
|
12
|
-
from .copernicus_dem import get_elevation
|
13
12
|
from .datamodel import Activity
|
14
13
|
from .datamodel import DB
|
15
14
|
from .missing_values import some
|
@@ -109,6 +108,8 @@ def enrichment_compute_tile_xy(
|
|
109
108
|
def enrichment_copernicus_elevation(
|
110
109
|
activity: Activity, time_series: pd.DataFrame, config: Config
|
111
110
|
) -> bool:
|
111
|
+
from .copernicus_dem import get_elevation
|
112
|
+
|
112
113
|
if "copernicus_elevation" not in time_series.columns:
|
113
114
|
time_series["copernicus_elevation"] = [
|
114
115
|
get_elevation(lat, lon)
|
@@ -247,7 +248,7 @@ enrichments: list[Callable[[Activity, pd.DataFrame, Config], bool]] = [
|
|
247
248
|
enrichment_normalize_time,
|
248
249
|
enrichment_rename_altitude,
|
249
250
|
enrichment_compute_tile_xy,
|
250
|
-
enrichment_copernicus_elevation,
|
251
|
+
# enrichment_copernicus_elevation,
|
251
252
|
enrichment_elevation_gain,
|
252
253
|
enrichment_add_calories,
|
253
254
|
enrichment_distance,
|
@@ -177,7 +177,7 @@ def make_activity_blueprint(
|
|
177
177
|
)
|
178
178
|
) is not None:
|
179
179
|
context["heart_zones_plot"] = heart_rate_zone_plot(heart_zones)
|
180
|
-
if "
|
180
|
+
if "elevation" in time_series.columns:
|
181
181
|
context["elevation_time_plot"] = elevation_time_plot(time_series)
|
182
182
|
if "elevation_gain_cum" in time_series.columns:
|
183
183
|
context["elevation_gain_cum_plot"] = elevation_gain_cum_plot(time_series)
|
@@ -508,7 +508,7 @@ def elevation_time_plot(time_series: pd.DataFrame) -> str:
|
|
508
508
|
.encode(
|
509
509
|
alt.X("time", title="Time"),
|
510
510
|
alt.Y(
|
511
|
-
"
|
511
|
+
"elevation",
|
512
512
|
scale=alt.Scale(zero=False),
|
513
513
|
title="Elevation / m",
|
514
514
|
),
|
{geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/METADATA
RENAMED
@@ -1,13 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: geo-activity-playground
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.2
|
4
4
|
Summary: Analysis of geo data activities like rides, runs or hikes.
|
5
5
|
License: MIT
|
6
6
|
Author: Martin Ueding
|
7
7
|
Author-email: mu@martin-ueding.de
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.10,<3.14
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
11
12
|
Classifier: Programming Language :: Python :: 3.11
|
12
13
|
Classifier: Programming Language :: Python :: 3.12
|
13
14
|
Classifier: Programming Language :: Python :: 3.13
|
@@ -15,7 +16,6 @@ Requires-Dist: Pillow (>=11.0.0,<12.0.0)
|
|
15
16
|
Requires-Dist: alembic (>=1.15.2,<2.0.0)
|
16
17
|
Requires-Dist: altair (>=5.5.0,<6.0.0)
|
17
18
|
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
|
18
|
-
Requires-Dist: boto3 (>=1.38.45,<2.0.0)
|
19
19
|
Requires-Dist: charset-normalizer (>=3.3.2,<4.0.0)
|
20
20
|
Requires-Dist: coloredlogs (>=15.0.1,<16.0.0)
|
21
21
|
Requires-Dist: exifread (>=3.2.0,<4.0.0)
|
@@ -24,24 +24,19 @@ Requires-Dist: flask (>=3.0.0,<4.0.0)
|
|
24
24
|
Requires-Dist: flask-alembic (>=3.1.1,<4.0.0)
|
25
25
|
Requires-Dist: flask-sqlalchemy (>=3.1.1,<4.0.0)
|
26
26
|
Requires-Dist: geojson (>=3.0.1,<4.0.0)
|
27
|
-
Requires-Dist: geotiff (>=0.2.10,<0.3.0)
|
28
27
|
Requires-Dist: gpxpy (>=1.5.0,<2.0.0)
|
29
|
-
Requires-Dist: imagecodecs (>=2025.3.30,<2026.0.0)
|
30
28
|
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
|
31
29
|
Requires-Dist: matplotlib (>=3.10.1,<4.0.0)
|
32
|
-
Requires-Dist: numcodecs (<0.15.0)
|
33
30
|
Requires-Dist: numpy (>=2.2.3,<3.0.0)
|
34
31
|
Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
|
35
32
|
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
36
33
|
Requires-Dist: pyarrow (>=19.0.1,<20.0.0)
|
37
34
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
38
35
|
Requires-Dist: requests (>=2.28.1,<3.0.0)
|
39
|
-
Requires-Dist: scipy (>=1.16.0,<2.0.0)
|
40
36
|
Requires-Dist: shapely (>=2.0.5,<3.0.0)
|
41
37
|
Requires-Dist: sqlalchemy (>=2.0.40,<3.0.0)
|
42
38
|
Requires-Dist: stravalib (>=2.0,<3.0)
|
43
39
|
Requires-Dist: tcxreader (>=0.4.5,<0.5.0)
|
44
|
-
Requires-Dist: tifffile (==2025.5.10)
|
45
40
|
Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
46
41
|
Requires-Dist: tqdm (>=4.64.0,<5.0.0)
|
47
42
|
Requires-Dist: vegafusion-python-embed (>=1.4.3,<2.0.0)
|
@@ -20,9 +20,9 @@ geo_activity_playground/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
20
20
|
geo_activity_playground/core/activities.py,sha256=apP_-Rg1ub3lh7RARMGXf2BOmJTiahxqpX_soEnYF3E,4681
|
21
21
|
geo_activity_playground/core/config.py,sha256=mmdMQ5iCLNGnAlriT1ETEVS-gM6Aq_9sg22QECHj4n8,5358
|
22
22
|
geo_activity_playground/core/coordinates.py,sha256=rW_OmMRpTUyIsQwrT6mgT9Y6uPGuwqTo5XDDMS7mGuo,1140
|
23
|
-
geo_activity_playground/core/copernicus_dem.py,sha256=
|
23
|
+
geo_activity_playground/core/copernicus_dem.py,sha256=t6Bc9fsyGyx1awdePXvlN-Zc-tiT2eGSJ80SV5B1Z9A,2944
|
24
24
|
geo_activity_playground/core/datamodel.py,sha256=3LdTm7lqykeLM6KYviW9WamgnS61nGNl-NHSEQdwTXY,15765
|
25
|
-
geo_activity_playground/core/enrichment.py,sha256=
|
25
|
+
geo_activity_playground/core/enrichment.py,sha256=pw9VEyDAtdNbjQ1HOPYyXCXT8SLL5i3Cp6KWjKK7puM,8708
|
26
26
|
geo_activity_playground/core/export.py,sha256=ayOmhWL72263oP9NLIZRYCg_Db0GLUFhgNIL_MCrV-E,4435
|
27
27
|
geo_activity_playground/core/heart_rate.py,sha256=-S3WAhS7AOywrw_Lk5jfuo_fu6zvZQ1VtjwEKSycWpU,1542
|
28
28
|
geo_activity_playground/core/meta_search.py,sha256=nyvCuR7v0pd6KjA8W5Kr71bBafRdE_ol7uSFRJs4eAM,6662
|
@@ -63,7 +63,7 @@ geo_activity_playground/webui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
63
63
|
geo_activity_playground/webui/app.py,sha256=4dCfzxPk7KJTAwEXyw3NPiQQz-udvgECqeL8CtOj0Es,10334
|
64
64
|
geo_activity_playground/webui/authenticator.py,sha256=dhREYOu_TCD_nzFNuSlHIbf5K6TmwKdXtr1wxD8fBcc,1491
|
65
65
|
geo_activity_playground/webui/blueprints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
|
-
geo_activity_playground/webui/blueprints/activity_blueprint.py,sha256=
|
66
|
+
geo_activity_playground/webui/blueprints/activity_blueprint.py,sha256=tFy0GpOBhIP8xlmYc9PF4kAng-0MosXMJudVupGz2Yw,26771
|
67
67
|
geo_activity_playground/webui/blueprints/auth_blueprint.py,sha256=iCm3hZphQKR9qFgytOrfnSmr-Og1gHuQ1Djiv2o_bkE,1031
|
68
68
|
geo_activity_playground/webui/blueprints/bubble_chart_blueprint.py,sha256=8R1rUVoyofGhUgesPunys1HoLPYinvhA46BBnMvEn9Q,2880
|
69
69
|
geo_activity_playground/webui/blueprints/calendar_blueprint.py,sha256=SmOu5AfNNoWcJJNduEfPtaPRvr4EZLYAeIDLUK9P1LY,2939
|
@@ -171,8 +171,8 @@ geo_activity_playground/webui/templates/summary/vega-chart.html.j2,sha256=mw8Hti
|
|
171
171
|
geo_activity_playground/webui/templates/time_zone_fixer/index.html.j2,sha256=s9r6BJMXmd7kLSyjkvH4xLi6e01S5bpGRcMgMMJyCAE,1760
|
172
172
|
geo_activity_playground/webui/templates/upload/index.html.j2,sha256=I1Ix8tDS3YBdi-HdaNfjkzYXVVCjfUTe5PFTnap1ydc,775
|
173
173
|
geo_activity_playground/webui/templates/upload/reload.html.j2,sha256=YZWX5eDeNyqKJdQAywDBcU8DZBm22rRBbZqFjrFrCvQ,556
|
174
|
-
geo_activity_playground-1.3.
|
175
|
-
geo_activity_playground-1.3.
|
176
|
-
geo_activity_playground-1.3.
|
177
|
-
geo_activity_playground-1.3.
|
178
|
-
geo_activity_playground-1.3.
|
174
|
+
geo_activity_playground-1.3.2.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
|
175
|
+
geo_activity_playground-1.3.2.dist-info/METADATA,sha256=0VFH55TyvrqQZOz60YN1odpofpP3iT7d5w8y2v6O268,1890
|
176
|
+
geo_activity_playground-1.3.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
177
|
+
geo_activity_playground-1.3.2.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
|
178
|
+
geo_activity_playground-1.3.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{geo_activity_playground-1.3.1.dist-info → geo_activity_playground-1.3.2.dist-info}/entry_points.txt
RENAMED
File without changes
|