fix: remove deprecated scipy.stats.stats imports#2222
Open
majiayu000 wants to merge 1 commit intoGiskard-AI:mainfrom
Open
fix: remove deprecated scipy.stats.stats imports#2222majiayu000 wants to merge 1 commit intoGiskard-AI:mainfrom
majiayu000 wants to merge 1 commit intoGiskard-AI:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scipy.stats.statsimports withscipy.statswasserstein_distanceimport fromscipy.stats.statstoscipy.statsKs_2sampResulttype annotation (deprecated in scipy>=1.12)The
ks_2sampfunction returns a result object withpvalueandstatisticattributes, which is sufficient for the existing code.Test plan
Fixes #2198