Skip to content

Commit 63a9862

Browse files
committed
change simple print to progress_bar log
1 parent 2cc3f3c commit 63a9862

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pymove/query/query.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def query_all_points_by_range(
309309
move_df: DataFrame,
310310
minimum_meters: Optional[float] = 100,
311311
minimum_time: Optional[timedelta] =timedelta(minutes=2),
312-
datetime_label: Optional[Text] = DATETIME):
312+
datetime_label: Optional[Text] = DATETIME
313+
):
313314
"""
314315
Queries closest point within a spatial range based on meters and a temporal range.
315316
@@ -360,18 +361,13 @@ def query_all_points_by_range(
360361
result = pd.DataFrame([])
361362
total = traj1.shape[0]
362363
count = 0
363-
for _, row in traj1.iterrows():
364-
clear_output(wait=True)
365-
print('{} de {}'.format(count, total))
366-
print('{:.2f}%'.format((count * 100 / total)))
364+
for _, row in progress_bar(
365+
traj1.iterrows(), desc="Querying all points by temporal and spatial distance", total=traj1.shape[0]
366+
):
367367
coinc_points = _meters_filter(row, move_df, minimum_meters)
368368
coinc_points = _datetime_filter(row, coinc_points, minimum_time)
369369
result = coinc_points.append(result)
370370

371371
count += 1
372372

373-
clear_output(wait=True)
374-
print('{} de {}'.format(count, total))
375-
print('{:.2f}%'.format((count * 100 / total)))
376-
377373
return result

0 commit comments

Comments
 (0)