Skip to content

Commit fcca69c

Browse files
committed
Fix bug
1 parent ef05185 commit fcca69c

2 files changed

Lines changed: 0 additions & 122 deletions

File tree

py_gps_data_codec.py

Lines changed: 0 additions & 97 deletions
This file was deleted.

test.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
import gps_data_codec
22

3-
import py_gps_data_codec
4-
5-
def first_location(locations_encoded):
6-
n = 0
7-
encoded = locations_encoded[:25]
8-
for idx, x in enumerate(encoded):
9-
if n == 3:
10-
return gps_data_codec.decode(encoded[:idx])[0]
11-
if ord(x) - 63 < 0x20:
12-
n += 1
13-
14-
def first_location_rust(locations_encoded):
15-
return gps_data_codec.decode_first_location(locations_encoded)
16-
173

184
def test_lib():
195
gps_data = [(-1,0,0),(1628667993, 4.56543, -110.53621), (1628667994, 4.56553, -110.53625)]
@@ -100,18 +86,7 @@ def test_lib():
10086
print("Decoding: ", t1 - t0)
10187
print("Encoding: ", t2 - t1)
10288
print("Total: ", t2 - t0)
103-
t0 = time.perf_counter()
104-
x2 = py_gps_data_codec.decode(data)
105-
t1 = time.perf_counter()
106-
s2 = py_gps_data_codec.encode(x2)
107-
t2 = time.perf_counter()
108-
assert(x1 == x2)
109-
assert(s1 == s2)
11089
assert(data == s1)
111-
print("-- Python --")
112-
print("Decoding: ", t1 - t0)
113-
print("Encoding: ", t2 - t1)
114-
print("Total: ", t2 - t0)
11590

11691

11792
if __name__ == "__main__":

0 commit comments

Comments
 (0)