Skip to content

Commit

Permalink
geodepy.test_geodesy
Browse files Browse the repository at this point in the history
Initial work on new test for vincentys inverse edgecases to resolve
bug in Issue #35

geodepy.test_convert
add if name is main to eof
  • Loading branch information
BatchelorJ committed Nov 25, 2018
1 parent 923b010 commit fcb4106
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions geodepy/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ def test_hp2dms(self):
def test_hp2ddm(self):
self.assertEqual(ddm_ex, hp2ddm(hp_ex))
self.assertEqual(-ddm_ex, hp2ddm(-hp_ex))


if __name__ == '__main__':
unittest.main()
15 changes: 14 additions & 1 deletion geodepy/tests/test_geodesy.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,22 @@ def test_equality_vincentys(self):
vincdir_result[:, 0], decimal=8)
np.testing.assert_almost_equal(test_pairs['long2'],
vincdir_result[:, 1], decimal=8)
np.testing.assert_almost_equal(vincinv_result[:,2],
np.testing.assert_almost_equal(vincinv_result[:, 2],
vincdir_result[:, 2])

def test_vincinv_edgecases(self):
lat1 = -32.153892
lon1 = -15.394827
lat2 = -31.587369
lon2 = -13.487739
gdist, az12, az21 = vincinv(lat1, lon1, lat2, lon2)
lon1 = lon1 + 14
lon2 = lon2 + 14
gdist_2, az12_2, az21_2 = vincinv(lat1, lon1, lat2, lon2)
self.assertEqual(gdist, gdist_2)
self.assertEqual(az12, az12_2)
self.assertEqual(az21, az21_2)


if __name__ == '__main__':
unittest.main()

0 comments on commit fcb4106

Please sign in to comment.