Skip to content

Document metric-specific **kwds parameters in pairwise_distances - #8459

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mmustafasenoglu:fix/document-pairwise-distances-kwds
Aug 7, 2026
Merged

Document metric-specific **kwds parameters in pairwise_distances#8459
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mmustafasenoglu:fix/document-pairwise-distances-kwds

Conversation

@mmustafasenoglu

Copy link
Copy Markdown
Contributor

Fixes #8281

This PR exhaustively documents all additional keyword parameters accepted by pairwise_distances for each metric that supports them:

  • minkowski: p (float, default=2.0) — the p-norm to apply
  • nan_euclidean: squared (bool), missing_values, copy (bool) — forwarded to nan_euclidean_distances

Also notes that all other metrics do not accept additional parameters and that unknown parameters raise TypeError.

This addresses the review comment in #8268 by @csadorf to exhaustively document metric-specific **kwds options.

Exhaustively document all additional keyword parameters accepted by
pairwise_distances for each metric that supports them:

- minkowski: p (float, default=2.0)
- nan_euclidean: squared (bool), missing_values, copy (bool)

Also notes that all other metrics do not accept additional parameters
and that unknown parameters raise TypeError.

Fixes NVIDIA#8281
@mmustafasenoglu
mmustafasenoglu requested a review from a team as a code owner August 6, 2026 13:11
@mmustafasenoglu
mmustafasenoglu requested review from dantegd and a lite review from Copilot August 6, 2026 13:11
@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 732f2576-2747-48a7-a647-ce8bf6fb6878

📥 Commits

Reviewing files that changed from the base of the PR and between 44259e9 and 558ff42.

📒 Files selected for processing (1)
  • python/cuml/cuml/metrics/pairwise_distances.pyx

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Expanded pairwise_distances documentation with parameters specific to Minkowski and nan_euclidean metrics.
    • Clarified that unsupported keyword parameters raise a TypeError for other metrics.

Walkthrough

The pairwise_distances documentation now lists parameters for the minkowski and nan_euclidean metrics. It also states that unsupported keyword parameters raise TypeError.

Changes

Pairwise distance parameter documentation

Layer / File(s) Summary
Document metric-specific parameters
python/cuml/cuml/metrics/pairwise_distances.pyx
Documents minkowski.p, nan_euclidean.squared, missing_values, and copy. Documents TypeError for unsupported keyword parameters.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: dantegd, copilot, jcrist

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the documentation change for metric-specific keyword parameters.
Description check ✅ Passed The description accurately explains the documented parameters and the related issue.
Linked Issues check ✅ Passed The PR exhaustively documents valid metric-specific keyword parameters for pairwise_distances as required by [#8281].
Out of Scope Changes check ✅ Passed The changes are limited to pairwise_distances documentation and align with the requirements in [#8281].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@jcrist jcrist added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 6, 2026
@jcrist

jcrist commented Aug 6, 2026

Copy link
Copy Markdown
Member

/ok to test 558ff42

@jcrist jcrist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@jcrist

jcrist commented Aug 7, 2026

Copy link
Copy Markdown
Member

/merge

@rapids-bot
rapids-bot Bot merged commit 342457b into NVIDIA:main Aug 7, 2026
100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document valid **kwds options to pass to pairwise_distances

5 participants