Skip to content

Fix codecov in tests for array api in pairwise metrics #29036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2024
Merged
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
4 changes: 4 additions & 0 deletions sklearn/metrics/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,10 @@ def check_array_api_metric_pairwise(metric, array_namespace, device, dtype_name)

metric_kwargs = {}
if "dense_output" in signature(metric).parameters:
metric_kwargs["dense_output"] = False
check_array_api_metric(
metric, array_namespace, device, dtype_name, a_np=X_np, b_np=Y_np
)
Comment on lines +1900 to +1902
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi all, just realised that we are not passing the metric_kwargs to the function (also in the function call below). I think it should be:

check_array_api_metric(
             metric, array_namespace, device, dtype_name, a_np=X_np, b_np=Y_np, ** metric_kwargs
         )

should I make another PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahrg! Yes please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for missing this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also missed it in the previous PR 😇

See fix here: #29045

metric_kwargs["dense_output"] = True

check_array_api_metric(
Expand Down
Loading