diff options
author | Gary E. Miller <gem@rellim.com> | 2017-07-01 14:52:29 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2017-07-01 14:52:29 -0700 |
commit | 1fc6f973af260f20ededc87ef0a20e4c3e65b913 (patch) | |
tree | 9bc8cfe80511b8a09113d4e942edef06d0605094 /test_misc.py | |
parent | 364f492b62cf287ed510501e193a0f8e81274085 (diff) | |
download | gpsd-1fc6f973af260f20ededc87ef0a20e4c3e65b913.tar.gz |
test_misc.py: pep8 fixes
Diffstat (limited to 'test_misc.py')
-rwxr-xr-x | test_misc.py | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/test_misc.py b/test_misc.py index 11f2a974..6af67bdc 100755 --- a/test_misc.py +++ b/test_misc.py @@ -15,106 +15,106 @@ errors = 0 # EarthDistanceSmall() is ellipsoid corrected. tests = [ # slow convergence - ( 0.00000000, 0.00000000, 0.50000000, 179.5000000, 19936288), + (0.00000000, 0.00000000, 0.50000000, 179.5000000, 19936288), # failure to converge, happens at antipodal points # fall back to EarthDistanceSmall() # the real answer should be 19944127 - ( 0.00000000, 0.00000000, 0.50000000, 179.7000000, 19870094), + (0.00000000, 0.00000000, 0.50000000, 179.7000000, 19870094), # boston to new york - ( 42.3541165, -71.0693514, 40.7791472, -73.9680804, 298396), + (42.3541165, -71.0693514, 40.7791472, -73.9680804, 298396), # equator 10 degree - ( 0.00000000, 0.00000000, 10.00000000, 0.00000000, 1105854), - ( 0.00000000, 0.00000000, 0.00000000, 10.00000000, 1113194), - ( 0.00000000, 0.00000000, 10.00000000, 10.00000000, 1565109), + (0.00000000, 0.00000000, 10.00000000, 0.00000000, 1105854), + (0.00000000, 0.00000000, 0.00000000, 10.00000000, 1113194), + (0.00000000, 0.00000000, 10.00000000, 10.00000000, 1565109), # 23N 10 degree - ( 23.00000000, 0.00000000, 33.00000000, 0.00000000, 1108210), - ( 23.00000000, 0.00000000, 23.00000000, 10.00000000, 1025026), - ( 23.00000000, 0.00000000, 33.00000000, 10.00000000, 1480049), + (23.00000000, 0.00000000, 33.00000000, 0.00000000, 1108210), + (23.00000000, 0.00000000, 23.00000000, 10.00000000, 1025026), + (23.00000000, 0.00000000, 33.00000000, 10.00000000, 1480049), # 45N 10 degree - ( 45.00000000, 0.00000000, 55.00000000, 0.00000000, 1112285), - ( 45.00000000, 0.00000000, 45.00000000, 10.00000000, 787967), - ( 45.00000000, 0.00000000, 55.00000000, 10.00000000, 1320437), + (45.00000000, 0.00000000, 55.00000000, 0.00000000, 1112285), + (45.00000000, 0.00000000, 45.00000000, 10.00000000, 787967), + (45.00000000, 0.00000000, 55.00000000, 10.00000000, 1320437), # 67N 10 degree - ( 67.00000000, 0.00000000, 77.00000000, 0.00000000, 1115839), - ( 67.00000000, 0.00000000, 67.00000000, 10.00000000, 435729), - ( 67.00000000, 0.00000000, 77.00000000, 10.00000000, 1164036), + (67.00000000, 0.00000000, 77.00000000, 0.00000000, 1115839), + (67.00000000, 0.00000000, 67.00000000, 10.00000000, 435729), + (67.00000000, 0.00000000, 77.00000000, 10.00000000, 1164036), # equator 5 degree - ( 0.00000000, 0.00000000, 5.00000000, 0.00000000, 552885), - ( 0.00000000, 0.00000000, 0.00000000, 5.00000000, 556597), - ( 0.00000000, 0.00000000, 5.00000010, 5.00000000, 784028), + (0.00000000, 0.00000000, 5.00000000, 0.00000000, 552885), + (0.00000000, 0.00000000, 0.00000000, 5.00000000, 556597), + (0.00000000, 0.00000000, 5.00000010, 5.00000000, 784028), # 23N 5 degree - ( 23.00000000, 0.00000000, 28.00000000, 0.00000000, 553904), - ( 23.00000000, 0.00000000, 23.00000000, 5.00000000, 512587), - ( 23.00000000, 0.00000000, 28.00000000, 5.00000000, 747800), + (23.00000000, 0.00000000, 28.00000000, 0.00000000, 553904), + (23.00000000, 0.00000000, 23.00000000, 5.00000000, 512587), + (23.00000000, 0.00000000, 28.00000000, 5.00000000, 747800), # 45N 5 degree - ( 45.00000000, 0.00000000, 50.00000000, 0.00000000, 555902), - ( 45.00000000, 0.00000000, 45.00000000, 5.00000000, 394171), - ( 45.00000000, 0.00000000, 50.00000000, 5.00000000, 671179), + (45.00000000, 0.00000000, 50.00000000, 0.00000000, 555902), + (45.00000000, 0.00000000, 45.00000000, 5.00000000, 394171), + (45.00000000, 0.00000000, 50.00000000, 5.00000000, 671179), # 67N 5 degree - ( 67.00000000, 0.00000000, 72.00000000, 0.00000000, 557775), - ( 67.00000000, 0.00000000, 67.00000000, 5.00000000, 218040), - ( 67.00000000, 0.00000000, 72.00000000, 5.00000000, 590565), + (67.00000000, 0.00000000, 72.00000000, 0.00000000, 557775), + (67.00000000, 0.00000000, 67.00000000, 5.00000000, 218040), + (67.00000000, 0.00000000, 72.00000000, 5.00000000, 590565), # equator 1 degree - ( 0.00000000, 0.00000000, 1.00000000, 0.00000000, 110574), - ( 0.00000000, 0.00000000, 0.00000000, 1.00000000, 111319), - ( 0.00000000, 0.00000000, 1.00000010, 1.00000000, 156899), + (0.00000000, 0.00000000, 1.00000000, 0.00000000, 110574), + (0.00000000, 0.00000000, 0.00000000, 1.00000000, 111319), + (0.00000000, 0.00000000, 1.00000010, 1.00000000, 156899), # 23N 1 degree - ( 23.00000000, 0.00000000, 24.00000000, 0.00000000, 110751), - ( 23.00000000, 0.00000000, 23.00000000, 1.00000000, 102522), - ( 23.00000000, 0.00000000, 24.00000000, 1.00000000, 150659), + (23.00000000, 0.00000000, 24.00000000, 0.00000000, 110751), + (23.00000000, 0.00000000, 23.00000000, 1.00000000, 102522), + (23.00000000, 0.00000000, 24.00000000, 1.00000000, 150659), # 45N 1 degree - ( 45.00000000, 0.00000000, 46.00000000, 0.00000000, 111141), - ( 45.00000000, 0.00000000, 45.00000000, 1.00000000, 78846), - ( 45.00000000, 0.00000000, 46.00000000, 1.00000000, 135869), + (45.00000000, 0.00000000, 46.00000000, 0.00000000, 111141), + (45.00000000, 0.00000000, 45.00000000, 1.00000000, 78846), + (45.00000000, 0.00000000, 46.00000000, 1.00000000, 135869), # 67N 1 degree - ( 67.00000000, 0.00000000, 68.00000000, 0.00000000, 111528), - ( 67.00000000, 0.00000000, 67.00000000, 1.00000000, 43619), - ( 67.00000000, 0.00000000, 68.00000000, 1.00000000, 119427), + (67.00000000, 0.00000000, 68.00000000, 0.00000000, 111528), + (67.00000000, 0.00000000, 67.00000000, 1.00000000, 43619), + (67.00000000, 0.00000000, 68.00000000, 1.00000000, 119427), # equator 10e-7 - ( 0.00000000, 0.00000000, 0.00000010, 0.00000000, 0.011057), - ( 0.00000000, 0.00000000, 0.00000000, 0.00000010, 0.011132), - ( 0.00000000, 0.00000000, 0.00000010, 0.00000010, 0.015690), + (0.00000000, 0.00000000, 0.00000010, 0.00000000, 0.011057), + (0.00000000, 0.00000000, 0.00000000, 0.00000010, 0.011132), + (0.00000000, 0.00000000, 0.00000010, 0.00000010, 0.015690), # 23N 10e-7 - ( 23.00000000, 0.00000000, 23.00000010, 0.00000000, 0.011074), - ( 23.00000000, 0.00000000, 23.00000000, 0.00000010, 0.010252), - ( 23.00000000, 0.00000000, 23.00000010, 0.00000010, 0.015091), + (23.00000000, 0.00000000, 23.00000010, 0.00000000, 0.011074), + (23.00000000, 0.00000000, 23.00000000, 0.00000010, 0.010252), + (23.00000000, 0.00000000, 23.00000010, 0.00000010, 0.015091), # 45N 10e-7 - ( 45.00000000, 0.00000000, 45.00000010, 0.00000000, 0.011113), - ( 45.00000000, 0.00000000, 45.00000000, 0.00000010, 0.007885), - ( 45.00000000, 0.00000000, 45.00000010, 0.00000010, 0.013626), + (45.00000000, 0.00000000, 45.00000010, 0.00000000, 0.011113), + (45.00000000, 0.00000000, 45.00000000, 0.00000010, 0.007885), + (45.00000000, 0.00000000, 45.00000010, 0.00000010, 0.013626), # 67N 10e-7 - ( 67.00000000, 0.00000000, 67.00000010, 0.00000000, 0.011152), - ( 67.00000000, 0.00000000, 67.00000000, 0.00000010, 0.004360), - ( 67.00000000, 0.00000000, 67.00000010, 0.00000010, 0.011974), + (67.00000000, 0.00000000, 67.00000010, 0.00000000, 0.011152), + (67.00000000, 0.00000000, 67.00000000, 0.00000010, 0.004360), + (67.00000000, 0.00000000, 67.00000010, 0.00000010, 0.011974), ] # EarthDistanceSmall -for ( lat1, lon1, lat2, lon2, dist) in tests : - distance = gps.misc.EarthDistanceSmall( (lat1, lon1), (lat2, lon2)) +for (lat1, lon1, lat2, lon2, dist) in tests: + distance = gps.misc.EarthDistanceSmall((lat1, lon1), (lat2, lon2)) # compare to 1% diff = dist - distance max_diff = dist * 0.01 - if abs( diff ) > max_diff: - sys.stderr.write( \ - "misc small: %.8f %.8f, %.8f %.8f, expected %.7f got %.7f\n" \ + if abs(diff) > max_diff: + sys.stderr.write( + "misc small: %.8f %.8f, %.8f %.8f, expected %.7f got %.7f\n" % (lat1, lon1, lat2, lon2, dist, distance)) errors += 1 else: - print("OK" ) + print("OK") # EarthDistance -for ( lat1, lon1, lat2, lon2, dist) in tests : - distance = gps.misc.EarthDistance( (lat1, lon1), (lat2, lon2)) +for (lat1, lon1, lat2, lon2, dist) in tests: + distance = gps.misc.EarthDistance((lat1, lon1), (lat2, lon2)) # compare to 0.001% diff = dist - distance max_diff = dist * 0.00001 - if abs( diff ) > max_diff: - sys.stderr.write( \ - "misc large: %.8f %.8f, %.8f %.8f, expected %.7f got %.7f\n" \ + if abs(diff) > max_diff: + sys.stderr.write( + "misc large: %.8f %.8f, %.8f %.8f, expected %.7f got %.7f\n" % (lat1, lon1, lat2, lon2, dist, distance)) errors += 1 else: - print("OK" ) + print("OK") if errors: sys.exit(1) |