1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Description: Revert scipy changes that use functionalities with 1.9.0 version as we
currently have 1.8.1 in debian
Author: Nilesh Patra <nilesh@debian.org>
Forwarded: not-needed
Last-Update: 2023-01-05
--- a/skbio/stats/distance/_mantel.py
+++ b/skbio/stats/distance/_mantel.py
@@ -13,8 +13,9 @@
import pandas as pd
import scipy.special
from scipy.stats import kendalltau
-from scipy.stats import ConstantInputWarning
-from scipy.stats import NearConstantInputWarning
+from scipy.stats import PearsonRConstantInputWarning
+from scipy.stats import PearsonRNearConstantInputWarning
+from scipy.stats import SpearmanRConstantInputWarning
from skbio.stats.distance import DistanceMatrix
from skbio.util._decorator import experimental
@@ -351,7 +352,7 @@
# If an input is constant, the correlation coefficient is not defined.
if (x_flat == x_flat[0]).all() or (y_flat == y_flat[0]).all():
- warnings.warn(ConstantInputWarning())
+ warnings.warn(PearsonRConstantInputWarning())
return np.nan, np.nan, []
# inline pearsonr, condensed from scipy.stats.pearsonr
@@ -374,7 +375,7 @@
# If all the values in x (likewise y) are very close to the mean,
# the loss of precision that occurs in the subtraction xm = x - xmean
# might result in large errors in r.
- warnings.warn(NearConstantInputWarning())
+ warnings.warn(PearsonRNearConstantInputWarning())
orig_stat = np.dot(xm_normalized, ym_normalized)
@@ -470,7 +471,7 @@
# If an input is constant, the correlation coefficient is not defined.
if (x_flat == x_flat[0]).all() or (y_flat == y_flat[0]).all():
- warnings.warn(ConstantInputWarning())
+ warnings.warn(SpearmanRConstantInputWarning())
return np.nan, np.nan, []
y_rank = scipy.stats.rankdata(y_flat)
|