Skip to content

fix: remove deprecated scipy.stats.stats imports#2222

Open
majiayu000 wants to merge 1 commit intoGiskard-AI:mainfrom
majiayu000:fix/scipy-deprecated-api
Open

fix: remove deprecated scipy.stats.stats imports#2222
majiayu000 wants to merge 1 commit intoGiskard-AI:mainfrom
majiayu000:fix/scipy-deprecated-api

Conversation

@majiayu000
Copy link

Summary

  • Replace deprecated scipy.stats.stats imports with scipy.stats
  • Move wasserstein_distance import from scipy.stats.stats to scipy.stats
  • Remove Ks_2sampResult type annotation (deprecated in scipy>=1.12)

The ks_2samp function returns a result object with pvalue and statistic attributes, which is sufficient for the existing code.

Test plan

  • Verified that the new imports work with current scipy versions
  • Existing drift tests should pass unchanged

Fixes #2198

Replace deprecated `scipy.stats.stats` imports with `scipy.stats`:
- Move `wasserstein_distance` import from `scipy.stats.stats` to `scipy.stats`
- Remove `Ks_2sampResult` type annotation (deprecated in scipy>=1.12)

The `ks_2samp` function returns a result object with `pvalue` and
`statistic` attributes, which is sufficient for the existing code.

Fixes Giskard-AI#2198

Signed-off-by: majiayu000 <1835304752@qq.com>
majiayu000 added a commit to majiayu000/giskard-oss that referenced this pull request Dec 30, 2025
Remove the upper version constraints on numpy (<2) and scipy (<1.12.0)
to allow compatibility with numpy 2.x and newer scipy versions.

- numpy: Changed from ">=1.26.0, <2" to ">=1.26.0"
- scipy: Changed from ">=1.7.3, <1.12.0" to ">=1.7.3"

This enables users to install giskard alongside other libraries that
require numpy 2.x, which has been stable for over a year.

Note: PR Giskard-AI#2222 already fixed the deprecated scipy.stats.stats imports
that were blocking scipy 1.12+ compatibility.

Fixes Giskard-AI#2173

Signed-off-by: majiayu000 <1835304752@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Use of deprecated SciPy API

1 participant