engine_test: improve _greggs test
This commit is contained in:
parent
2edce7c73a
commit
1b280827ea
1 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from engine import encode_greggs, decode_greggs, encode, decode, format_location, parse_location, spherical_dist, fetch_data
|
||||
from engine import encode_greggs, decode_greggs, encode, decode, format_location, parse_location, spherical_dist, fetch_data, format_dist, parse_dist
|
||||
from tqdm import tqdm
|
||||
import numpy as np
|
||||
import time
|
||||
|
|
@ -62,8 +62,11 @@ def test_encode_decode_greggs():
|
|||
encoded = encode_greggs(i)
|
||||
# tqdm.write(f"Encoding took {time.monotonic() - t:.3f}s")
|
||||
|
||||
stringified = ",".join(map(format_dist, encoded))
|
||||
parsed = [parse_dist(s.strip()) for s in stringified.split(",")]
|
||||
|
||||
# t = time.monotonic()
|
||||
decoded = decode_greggs(encoded)
|
||||
decoded = decode_greggs(parsed)
|
||||
# tqdm.write(f"Decoding took {time.monotonic() - t:.3f}s")
|
||||
|
||||
if i != decoded:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue