Problem
tslearn.clustering.silhouette_samples(X, labels, metric="precomputed", metric_params=..., n_jobs=..., verbose=...) silently drops all of metric_params, **kwds, n_jobs, and verbose. The docstring promises metric_params and **kwds are passed to the distance function, and silhouette_score raises on unexpected kwargs via sklearn forwarding, so the silent no-op is a contract inconsistency on the new API surface.
Suggested fix (design call)
Either (a) raise TypeError for any non-None metric_params/n_jobs/verbose/**kwds on the precomputed branch (loud rejection, parity with silhouette_score), or (b) explicitly document that these are ignored when metric == "precomputed".
Metadata
Severity: P3
Confidence: 75
Reviewer(s): api-contract, adversarial (ce-code-review run 20260821-221628-4e205155 on PR #703)
Finding ID: tslearn/clustering/utils.py:330 silhouette_samples(metric="precomputed") silently drops metric_params
Problem
tslearn.clustering.silhouette_samples(X, labels, metric="precomputed", metric_params=..., n_jobs=..., verbose=...)silently drops all ofmetric_params,**kwds,n_jobs, andverbose. The docstring promisesmetric_paramsand**kwdsare passed to the distance function, andsilhouette_scoreraises on unexpected kwargs via sklearn forwarding, so the silent no-op is a contract inconsistency on the new API surface.Suggested fix (design call)
Either (a) raise
TypeErrorfor any non-Nonemetric_params/n_jobs/verbose/**kwdson the precomputed branch (loud rejection, parity withsilhouette_score), or (b) explicitly document that these are ignored whenmetric == "precomputed".Metadata
Severity: P3
Confidence: 75
Reviewer(s): api-contract, adversarial (ce-code-review run 20260821-221628-4e205155 on PR #703)
Finding ID: tslearn/clustering/utils.py:330 silhouette_samples(metric="precomputed") silently drops metric_params