Skip to content

Commit c06c4d3

Browse files
committed
ADd timestamps for debuggig purposes
1 parent c81c149 commit c06c4d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

weight_predict/weight_predict.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import math
77
import database as db
88
import pandas as pd
9+
import time
910

1011
MAX_ITEM_REMOVALS_TO_CHECK = 3
1112
THRESHOLD_WEIGHT_PROBABILITY = 30
@@ -160,10 +161,12 @@ def main():
160161
for i, new_weight in enumerate(json_data['slot_weights_g']):
161162
item_changes = shelf.slots[i].predict_most_likely_item(new_weight)
162163
for item_change in item_changes:
164+
165+
time_str = time.strftime("%H:%M:%S.") + f"{int((time.time() * 1000) % 1000):03d}"
163166
if item_change.quantity > 0:
164-
print(f"Remove {abs(item_change.quantity)} {item_change.name} from cart")
167+
print(f"{time_str}: Remove {abs(item_change.quantity)} {item_change.name} from cart")
165168
else:
166-
print(f"Add {abs(item_change.quantity)} {item_change.name} to cart")
169+
print(f"{time_str}: Add {abs(item_change.quantity)} {item_change.name} to cart")
167170

168171
else:
169172
# New shelf, just save this as the previous slot data

0 commit comments

Comments
 (0)