Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TST: increase monte carlo tests
  • Loading branch information
Gui-FernandesBR committed Nov 1, 2024
commit 6d7a537c8f739f19e71eef29ddd5243fb9485f64
2 changes: 1 addition & 1 deletion tests/integration/test_monte_carlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_monte_carlo_export_ellipses_to_kml(monte_carlo_calisto_pre_loaded):
filename="monte_carlo_class_example.kml",
origin_lat=32.990254,
origin_lon=-106.974998,
type="impact",
type="all",
)
is None
)
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
calculate_cubic_hermite_coefficients,
euler313_to_quaternions,
find_roots_cubic_function,
haversine,
)


Expand Down Expand Up @@ -58,3 +59,16 @@ def test_cardanos_root_finding():
assert np.isclose(roots[0].imag, 0)
assert np.isclose(roots[1].imag, 0)
assert np.isclose(roots[2].imag, 0)


@pytest.mark.parametrize(
"lat0, lon0, lat1, lon1, expected_distance",
[
(0, 0, 0, 0, 0),
(45, 45, 45, 45, 0),
(-23.508958, -46.720080, -23.522939, -46.558253, 16591.438),
],
) # These values were calculated with google earth
def test_haversine(lat0, lon0, lat1, lon1, expected_distance):
distance = haversine(lat0, lon0, lat1, lon1)
assert np.isclose(distance, expected_distance, rtol=1e-2)