geo-activity-playground 0.24.0__py3-none-any.whl → 0.24.1__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/activities.py +5 -0
- geo_activity_playground/importers/strava_api.py +2 -1
- geo_activity_playground/webui/activity/blueprint.py +1 -1
- geo_activity_playground/webui/activity/controller.py +1 -1
- geo_activity_playground/webui/heatmap/heatmap_controller.py +3 -1
- {geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/METADATA +1 -1
- {geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/RECORD +10 -10
- {geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/LICENSE +0 -0
- {geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/WHEEL +0 -0
- {geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/entry_points.txt +0 -0
@@ -48,6 +48,10 @@ class ActivityRepository:
|
|
48
48
|
self.meta = pd.read_parquet(activities_path())
|
49
49
|
self.meta.index = self.meta["id"]
|
50
50
|
self.meta.index.name = "index"
|
51
|
+
if not pd.api.types.is_dtype_equal(
|
52
|
+
self.meta["start"].dtype, "datetime64[ns]"
|
53
|
+
):
|
54
|
+
self.meta["start"] = convert_to_datetime_ns(self.meta["start"])
|
51
55
|
else:
|
52
56
|
self.meta = pd.DataFrame()
|
53
57
|
|
@@ -88,6 +92,7 @@ class ActivityRepository:
|
|
88
92
|
old_df = self.meta.loc[is_kept]
|
89
93
|
else:
|
90
94
|
old_df = self.meta
|
95
|
+
|
91
96
|
self.meta = pd.concat([old_df, new_df])
|
92
97
|
assert pd.api.types.is_dtype_equal(
|
93
98
|
self.meta["start"].dtype, "datetime64[ns]"
|
@@ -17,6 +17,7 @@ from tqdm import tqdm
|
|
17
17
|
from geo_activity_playground.core.activities import ActivityRepository
|
18
18
|
from geo_activity_playground.core.config import get_config
|
19
19
|
from geo_activity_playground.core.paths import cache_dir
|
20
|
+
from geo_activity_playground.core.time_conversion import convert_to_datetime_ns
|
20
21
|
|
21
22
|
|
22
23
|
logger = logging.getLogger(__name__)
|
@@ -165,7 +166,7 @@ def try_import_strava(repository: ActivityRepository) -> bool:
|
|
165
166
|
"distance_km": activity.distance.magnitude / 1000,
|
166
167
|
"name": activity.name,
|
167
168
|
"kind": str(activity.type),
|
168
|
-
"start": activity.start_date,
|
169
|
+
"start": convert_to_datetime_ns(activity.start_date),
|
169
170
|
"elapsed_time": activity.elapsed_time,
|
170
171
|
"equipment": gear_names[activity.gear_id],
|
171
172
|
"calories": detailed_activity.calories,
|
@@ -452,7 +452,7 @@ def make_sharepic(activity: ActivityMeta, time_series: pd.DataFrame) -> bytes:
|
|
452
452
|
f"\n{activity['distance_km']:.1f} km",
|
453
453
|
re.sub(r"^0 days ", "", f"{activity['elapsed_time']}"),
|
454
454
|
]
|
455
|
-
if activity["calories"]:
|
455
|
+
if activity["calories"] and not pd.isna(activity["calories"]):
|
456
456
|
facts.append(f"{activity['calories']:.0f} kcal")
|
457
457
|
if activity["steps"] and not pd.isna(activity["steps"]):
|
458
458
|
facts.append(f"{activity['steps']:.0f} steps")
|
@@ -11,6 +11,7 @@ from geo_activity_playground.core.activities import ActivityRepository
|
|
11
11
|
from geo_activity_playground.core.heatmap import convert_to_grayscale
|
12
12
|
from geo_activity_playground.core.heatmap import GeoBounds
|
13
13
|
from geo_activity_playground.core.heatmap import get_sensible_zoom_level
|
14
|
+
from geo_activity_playground.core.heatmap import PixelBounds
|
14
15
|
from geo_activity_playground.core.tasks import work_tracker
|
15
16
|
from geo_activity_playground.core.tiles import get_tile
|
16
17
|
from geo_activity_playground.core.tiles import get_tile_upper_left_lat_lon
|
@@ -140,8 +141,9 @@ class HeatmapController:
|
|
140
141
|
) -> bytes:
|
141
142
|
geo_bounds = GeoBounds(south, west, north, east)
|
142
143
|
tile_bounds = get_sensible_zoom_level(geo_bounds, (4000, 4000))
|
144
|
+
pixel_bounds = PixelBounds.from_tile_bounds(tile_bounds)
|
143
145
|
|
144
|
-
background = np.zeros((*
|
146
|
+
background = np.zeros((*pixel_bounds.shape, 3))
|
145
147
|
for x in range(tile_bounds.x_tile_min, tile_bounds.x_tile_max):
|
146
148
|
for y in range(tile_bounds.y_tile_min, tile_bounds.y_tile_max):
|
147
149
|
tile = np.array(get_tile(tile_bounds.zoom, x, y)) / 255
|
{geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/RECORD
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
geo_activity_playground/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
geo_activity_playground/__main__.py,sha256=pAl5_cWjuNyGmE_zMoPtG7Gc7r7lNk3psn9CAxzP2fU,4131
|
3
3
|
geo_activity_playground/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
geo_activity_playground/core/activities.py,sha256=
|
4
|
+
geo_activity_playground/core/activities.py,sha256=giZYepqGK3NujGpcCrYvF0rYDyVMopIMdXrvWBvbRm4,11606
|
5
5
|
geo_activity_playground/core/activity_parsers.py,sha256=pjYjnaAXsWfUNOoomYWOmmFZO5Qs076RWM-pqNdo7BA,10905
|
6
6
|
geo_activity_playground/core/cache_migrations.py,sha256=tkGA0h69-m-0Ek7JjvfVOX45YXLXkh_ZvC2TKB_fvbA,4281
|
7
7
|
geo_activity_playground/core/config.py,sha256=YjqCiEmIAa-GM1-JfBctMEsl8-I56pZyyDdTyPduOzw,477
|
@@ -21,14 +21,14 @@ geo_activity_playground/explorer/tile_visits.py,sha256=fkn2Pgk-pBmC0ywDa0g2T9f4L
|
|
21
21
|
geo_activity_playground/explorer/video.py,sha256=ROAmV9shfJyqTgnXVD41KFORiwnRgVpEWenIq4hMCRM,4389
|
22
22
|
geo_activity_playground/importers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
geo_activity_playground/importers/directory.py,sha256=6KUxMMJELq1WWQSbqAWt6ZVlZh7Np3LMJNkt6jPN5eI,4506
|
24
|
-
geo_activity_playground/importers/strava_api.py,sha256=
|
24
|
+
geo_activity_playground/importers/strava_api.py,sha256=FJYamDBmHmB8uA9dNc0h0j7EgZPCofCspL2Wfq-PrTg,7869
|
25
25
|
geo_activity_playground/importers/strava_checkout.py,sha256=nvZX7skevqMWdW9Gxzt4VhwCaI3wv2z5g-ODv6ZWxng,8078
|
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
|
-
geo_activity_playground/webui/activity/blueprint.py,sha256=
|
31
|
-
geo_activity_playground/webui/activity/controller.py,sha256=
|
30
|
+
geo_activity_playground/webui/activity/blueprint.py,sha256=gGMes5ycXi2rMixVYs4NQgzTU1Vttgu50prYAe3--Hs,1749
|
31
|
+
geo_activity_playground/webui/activity/controller.py,sha256=CoNi9dJlGS-pZMEh14eZqWkbbLRHvQ01PEk8jRXpmgU,16665
|
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
|
@@ -54,7 +54,7 @@ geo_activity_playground/webui/explorer/controller.py,sha256=8d0FFrG55ZlPQ5seQC2D
|
|
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=fM92NfeJ_qhXkuAT01Btkzeb_SbAgExxql_OH1G31os,6477
|
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
|
@@ -88,8 +88,8 @@ geo_activity_playground/webui/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
88
88
|
geo_activity_playground/webui/upload/blueprint.py,sha256=2l5q1LYtjgLF_3CAyPvCLx-wMebp14OJvgZBzGILdmQ,801
|
89
89
|
geo_activity_playground/webui/upload/controller.py,sha256=QrHfqRxroLuzBBNNSheUx-qJ9ww1sXT1oPdpS7Jx_ro,4092
|
90
90
|
geo_activity_playground/webui/upload/templates/upload/index.html.j2,sha256=hfXkEXaz_MkM46rU56423D6V6WtK-EAXPszSY-_-Tx8,1471
|
91
|
-
geo_activity_playground-0.24.
|
92
|
-
geo_activity_playground-0.24.
|
93
|
-
geo_activity_playground-0.24.
|
94
|
-
geo_activity_playground-0.24.
|
95
|
-
geo_activity_playground-0.24.
|
91
|
+
geo_activity_playground-0.24.1.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
|
92
|
+
geo_activity_playground-0.24.1.dist-info/METADATA,sha256=59LmZVNZAf8R-8Lbab3__MuB4tWbW_KuApJsIcDzJxo,1665
|
93
|
+
geo_activity_playground-0.24.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
94
|
+
geo_activity_playground-0.24.1.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
|
95
|
+
geo_activity_playground-0.24.1.dist-info/RECORD,,
|
{geo_activity_playground-0.24.0.dist-info → geo_activity_playground-0.24.1.dist-info}/LICENSE
RENAMED
File without changes
|
File without changes
|
File without changes
|