geo-activity-playground 0.40.0__py3-none-any.whl → 0.40.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.
@@ -112,12 +112,12 @@ class Activity(DB.Model):
112
112
 
113
113
  @property
114
114
  def average_speed_moving_kmh(self) -> Optional[float]:
115
- if self.moving_time is not None:
115
+ if self.moving_time:
116
116
  return self.distance_km / (self.moving_time.total_seconds() / 3_600)
117
117
 
118
118
  @property
119
119
  def average_speed_elapsed_kmh(self) -> Optional[float]:
120
- if self.elapsed_time is not None:
120
+ if self.elapsed_time:
121
121
  return self.distance_km / (self.elapsed_time.total_seconds() / 3_600)
122
122
 
123
123
  @property
@@ -1,7 +1,20 @@
1
+ import datetime
2
+
1
3
  from .datamodel import Activity
2
4
 
3
5
 
4
- def test_zero_duration() -> None:
6
+ def test_no_duration() -> None:
5
7
  activity = Activity(name="Test", distance_km=10.0)
6
8
  assert activity.average_speed_elapsed_kmh is None
7
9
  assert activity.average_speed_moving_kmh is None
10
+
11
+
12
+ def test_zero_duration() -> None:
13
+ activity = Activity(
14
+ name="Test",
15
+ distance_km=10.0,
16
+ elapsed_time=datetime.timedelta(seconds=0),
17
+ moving_time=datetime.timedelta(seconds=0),
18
+ )
19
+ assert activity.average_speed_elapsed_kmh is None
20
+ assert activity.average_speed_moving_kmh is None
@@ -271,9 +271,8 @@ def convert_strava_checkout(
271
271
  continue
272
272
 
273
273
  activity_date = dateutil.parser.parse(row["Activity Date"])
274
- activity_name = row["Activity Name"]
274
+ activity_name: str = row["Activity Name"]
275
275
  activity_kind = row["Activity Type"]
276
- is_commute = row["Commute"] == "true" or row["Commute"] == True
277
276
  equipment = (
278
277
  nan_as_none(row["Activity Gear"])
279
278
  or nan_as_none(row["Bike"])
@@ -285,8 +284,6 @@ def convert_strava_checkout(
285
284
  activity_target = playground_path / "Activities" / str(activity_kind)
286
285
  if equipment:
287
286
  activity_target /= str(equipment)
288
- if is_commute:
289
- activity_target /= "Commute"
290
287
 
291
288
  activity_target /= "".join(
292
289
  [
@@ -294,7 +291,7 @@ def convert_strava_checkout(
294
291
  "-",
295
292
  f"{activity_date.hour:02d}-{activity_date.minute:02d}-{activity_date.second:02d}",
296
293
  " ",
297
- activity_name,
294
+ activity_name.replace("/", "_"),
298
295
  ]
299
296
  + activity_file.suffixes
300
297
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geo-activity-playground
3
- Version: 0.40.0
3
+ Version: 0.40.1
4
4
  Summary: Analysis of geo data activities like rides, runs or hikes.
5
5
  License: MIT
6
6
  Author: Martin Ueding
@@ -14,7 +14,7 @@ geo_activity_playground/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
14
14
  geo_activity_playground/core/activities.py,sha256=R3RDvOkHyWL2Wr-Bgqjgr5wDjVqaJ3WSECL2fbMyiu8,5485
15
15
  geo_activity_playground/core/config.py,sha256=eGWWbNfHa6H64AHCnFYTsAJ7-pWi-PhyxL4hjZ4u03U,5256
16
16
  geo_activity_playground/core/coordinates.py,sha256=tDfr9mlXhK6E_MMIJ0vYWVCoH0Lq8uyuaqUgaa8i0jg,966
17
- geo_activity_playground/core/datamodel.py,sha256=v5tLkPO53ilVIE78_gLz7igi6qh0ffdDPJmF7P2lkgE,10303
17
+ geo_activity_playground/core/datamodel.py,sha256=EHfZEYL4Dc881R5fL7eiJ24867NYgAbdXtRYI_I-sPI,10279
18
18
  geo_activity_playground/core/enrichment.py,sha256=kc9747ocSs2_3R7oW9Rjs3_lKP37gdvBUbyWpILaqHc,7346
19
19
  geo_activity_playground/core/heart_rate.py,sha256=-S3WAhS7AOywrw_Lk5jfuo_fu6zvZQ1VtjwEKSycWpU,1542
20
20
  geo_activity_playground/core/meta_search.py,sha256=naErjAC7ZCFhOF6d492kbegZxCdzbpGcJvjQLJTE4xE,5016
@@ -25,7 +25,7 @@ geo_activity_playground/core/raster_map.py,sha256=Cq8dNLdxVQg3Agzn2bmXVu0-8kZf56
25
25
  geo_activity_playground/core/similarity.py,sha256=L2de3DPRdDeDY5AxZwLDcH7FjHWRWklr41VNU06q9kQ,3117
26
26
  geo_activity_playground/core/summary_stats.py,sha256=v5FtWnE1imDF5axI6asVN55wCrlD73oZ6lvqzxsTN2c,1006
27
27
  geo_activity_playground/core/tasks.py,sha256=-_9cxekoHSWzCW4XblNeqrwi2tTqr5AE7_-p8fdqhwc,2886
28
- geo_activity_playground/core/test_datamodel.py,sha256=noNgiGzs2BOZvdi2FosLvW8YTinE6Gl7_JrEs7D8GBI,230
28
+ geo_activity_playground/core/test_datamodel.py,sha256=-VrGHgx5Z3MSQPqHGmmm7atRJYbg5y_ukvRHKxk22PI,569
29
29
  geo_activity_playground/core/test_meta_search.py,sha256=zhuD343Xce-4Fkznw81DHQ7pK5eyX5UbcyCHuYRKsr8,3091
30
30
  geo_activity_playground/core/test_summary_stats.py,sha256=qH_45mPRFD2H-Rr0Ku-RYc67vhC7qKxbPr7J2F36uV8,3081
31
31
  geo_activity_playground/core/test_tiles.py,sha256=zce1FxNfsSpOQt66jMehdQRVoNdl-oiFydx6iVBHZXM,764
@@ -42,7 +42,7 @@ geo_activity_playground/importers/activity_parsers.py,sha256=yD7L5eDOpiLWf6RHSQf
42
42
  geo_activity_playground/importers/csv_parser.py,sha256=O1pP5GLhWhnWcy2Lsrr9g17Zspuibpt-GtZ3ZS5eZF4,2143
43
43
  geo_activity_playground/importers/directory.py,sha256=4Q7UAFa7ztkgqf4FvPbH2LlrO-7a8Fu7tkYPHOpHm1g,5210
44
44
  geo_activity_playground/importers/strava_api.py,sha256=J0-VXNrLq22fhTcWkQPE5AVrzy5aegC7SBi-UXFtAy4,7576
45
- geo_activity_playground/importers/strava_checkout.py,sha256=uNcmA-ADURNpW5zJdRkG07eHjj1MVoIKsv0EWdc5iRw,10090
45
+ geo_activity_playground/importers/strava_checkout.py,sha256=3AEFlNr811MdVz_Ww1zz_alptr_3mDvGr188bM3qU7U,9977
46
46
  geo_activity_playground/importers/test_csv_parser.py,sha256=nOTVTdlzIY0TDcbWp7xNyNaIO6Mkeu55hVziVl22QE4,1092
47
47
  geo_activity_playground/importers/test_directory.py,sha256=_fn_-y98ZyElbG0BRxAmGFdtGobUShPU86SdEOpuv-A,691
48
48
  geo_activity_playground/importers/test_strava_api.py,sha256=7b8bl5Rh2BctCmvTPEhCadxtUOq3mfzuadD6F5XxRio,398
@@ -138,8 +138,8 @@ geo_activity_playground/webui/templates/square_planner/index.html.j2,sha256=-OnY
138
138
  geo_activity_playground/webui/templates/summary/index.html.j2,sha256=T8YUGMXaZYeVl7Q5-H1YhdnGo3bx_LtExPQ60qj_Zhs,5638
139
139
  geo_activity_playground/webui/templates/upload/index.html.j2,sha256=I1Ix8tDS3YBdi-HdaNfjkzYXVVCjfUTe5PFTnap1ydc,775
140
140
  geo_activity_playground/webui/templates/upload/reload.html.j2,sha256=YZWX5eDeNyqKJdQAywDBcU8DZBm22rRBbZqFjrFrCvQ,556
141
- geo_activity_playground-0.40.0.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
142
- geo_activity_playground-0.40.0.dist-info/METADATA,sha256=lhX789KVp1udKHGEsa3XojbAwFYRHs2X1E0DlTr9veo,1758
143
- geo_activity_playground-0.40.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
144
- geo_activity_playground-0.40.0.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
145
- geo_activity_playground-0.40.0.dist-info/RECORD,,
141
+ geo_activity_playground-0.40.1.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
142
+ geo_activity_playground-0.40.1.dist-info/METADATA,sha256=A-lrCQSSUmsBauIvH6dFq3Gbn7nlKQmstaPaN78TInw,1758
143
+ geo_activity_playground-0.40.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
144
+ geo_activity_playground-0.40.1.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
145
+ geo_activity_playground-0.40.1.dist-info/RECORD,,