Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,15 @@
"contributions": [
"doc"
]
},
{
"login": "tanishy7777",
"name": "Tanish Yelgoe",
"avatar_url": "https://avatars.githubusercontent.com/u/143334319?v=4",
"profile": "https://www.tanishyelgoe.tech/",
"contributions": [
"code"
]
}
],
"commitType": "docs"
Expand Down
13 changes: 11 additions & 2 deletions aeon/distances/tests/test_distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def _validate_distance_result(
x, y, name, distance, expected_result=10, check_xy_permuted=True
x, y, name, distance, symmetric, expected_result=10, check_xy_permuted=True
):
"""
Validate the distance result by comparing it with the expected result.
Expand Down Expand Up @@ -57,12 +57,13 @@ def _validate_distance_result(
assert isinstance(dist_result_to_self, float)

# If unequal length swap where x and y are to ensure it works both ways around
if original_x.shape[-1] != original_y.shape[-1] and check_xy_permuted:
if symmetric and original_x.shape[-1] != original_y.shape[-1] and check_xy_permuted:
_validate_distance_result(
original_y,
original_x,
name,
distance,
symmetric,
expected_result,
check_xy_permuted=False,
)
Expand All @@ -82,6 +83,7 @@ def test_distances(dist):
make_example_1d_numpy(10, random_state=2),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][0],
)

Expand All @@ -91,6 +93,7 @@ def test_distances(dist):
make_example_2d_numpy_series(10, 1, random_state=2),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][0],
)

Expand All @@ -100,6 +103,7 @@ def test_distances(dist):
make_example_2d_numpy_series(10, 1, random_state=2),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][1],
)

Expand All @@ -111,6 +115,7 @@ def test_distances(dist):
make_example_1d_numpy(10, random_state=2),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][2],
)

Expand All @@ -120,6 +125,7 @@ def test_distances(dist):
make_example_2d_numpy_series(10, 1, random_state=2),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][2],
)

Expand All @@ -129,6 +135,7 @@ def test_distances(dist):
make_example_2d_numpy_series(10, 10, random_state=2),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][3],
)

Expand All @@ -140,6 +147,7 @@ def test_distances(dist):
np.array([15.0]),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][4],
)

Expand All @@ -149,6 +157,7 @@ def test_distances(dist):
np.array([[15.0]]),
dist["name"],
dist["distance"],
dist["symmetric"],
_expected_distance_results[dist["name"]][4],
)

Expand Down