Skip to content

Commit 5fd7dbd

Browse files
committed
fix scipy.stats._morestats stubtests
1 parent 7ca1c72 commit 5fd7dbd

File tree

1 file changed

+109
-72
lines changed

1 file changed

+109
-72
lines changed

scipy-stubs/stats/_morestats.pyi

Lines changed: 109 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import NamedTuple
22

3-
from scipy._typing import Untyped
3+
from scipy._typing import Alternative, NanPolicy, Untyped
44

55
__all__ = [
66
"anderson",
@@ -35,6 +35,31 @@ __all__ = [
3535
"yeojohnson_normplot",
3636
]
3737

38+
class DirectionalStats:
39+
mean_direction: Untyped
40+
mean_resultant_length: Untyped
41+
def __init__(self, mean_direction, mean_resultant_length) -> None: ...
42+
43+
class ShapiroResult(NamedTuple):
44+
statistic: Untyped
45+
pvalue: Untyped
46+
47+
class AnsariResult(NamedTuple):
48+
statistic: Untyped
49+
pvalue: Untyped
50+
51+
class BartlettResult(NamedTuple):
52+
statistic: Untyped
53+
pvalue: Untyped
54+
55+
class LeveneResult(NamedTuple):
56+
statistic: Untyped
57+
pvalue: Untyped
58+
59+
class FlignerResult(NamedTuple):
60+
statistic: Untyped
61+
pvalue: Untyped
62+
3863
class Mean(NamedTuple):
3964
statistic: Untyped
4065
minmax: Untyped
@@ -47,10 +72,30 @@ class Std_dev(NamedTuple):
4772
statistic: Untyped
4873
minmax: Untyped
4974

75+
# TODO: bunches
76+
AndersonResult: Untyped
77+
Anderson_ksampResult: Untyped
78+
WilcoxonResult: Untyped
79+
MedianTestResult: Untyped
80+
5081
def bayes_mvs(data, alpha: float = 0.9) -> Untyped: ...
5182
def mvsdist(data) -> Untyped: ...
52-
def kstat(data, n: int = 2, *, axis: Untyped | None = None) -> Untyped: ...
53-
def kstatvar(data, n: int = 2, *, axis: Untyped | None = None) -> Untyped: ...
83+
def kstat(
84+
data,
85+
n: int = 2,
86+
*,
87+
axis: int | None = None,
88+
nan_policy: NanPolicy = "propagate",
89+
keepdims: bool = False,
90+
) -> Untyped: ...
91+
def kstatvar(
92+
data,
93+
n: int = 2,
94+
*,
95+
axis: int | None = None,
96+
nan_policy: NanPolicy = "propagate",
97+
keepdims: bool = False,
98+
) -> Untyped: ...
5499
def probplot(
55100
x,
56101
sparams=(),
@@ -63,9 +108,6 @@ def ppcc_max(x, brack=(0.0, 1.0), dist: str = "tukeylambda") -> Untyped: ...
63108
def ppcc_plot(x, a, b, dist: str = "tukeylambda", plot: Untyped | None = None, N: int = 80) -> Untyped: ...
64109
def boxcox_llf(lmb, data) -> Untyped: ...
65110
def boxcox(x, lmbda: Untyped | None = None, alpha: Untyped | None = None, optimizer: Untyped | None = None) -> Untyped: ...
66-
67-
class _BigFloat: ...
68-
69111
def boxcox_normmax(
70112
x,
71113
brack: Untyped | None = None,
@@ -79,59 +121,44 @@ def yeojohnson(x, lmbda: Untyped | None = None) -> Untyped: ...
79121
def yeojohnson_llf(lmb, data) -> Untyped: ...
80122
def yeojohnson_normmax(x, brack: Untyped | None = None) -> Untyped: ...
81123
def yeojohnson_normplot(x, la, lb, plot: Untyped | None = None, N: int = 80) -> Untyped: ...
82-
83-
class ShapiroResult(NamedTuple):
84-
statistic: Untyped
85-
pvalue: Untyped
86-
87-
def shapiro(x) -> Untyped: ...
88-
89-
AndersonResult: Untyped
90-
124+
def shapiro(x, *, axis: int | None = None, nan_policy: NanPolicy = "propagate", keepdims: bool = False) -> Untyped: ...
91125
def anderson(x, dist: str = "norm") -> Untyped: ...
92-
93-
Anderson_ksampResult: Untyped
94-
95126
def anderson_ksamp(samples, midrank: bool = True, *, method: Untyped | None = None) -> Untyped: ...
96-
97-
class AnsariResult(NamedTuple):
98-
statistic: Untyped
99-
pvalue: Untyped
100-
101-
class _ABW:
102-
m: Untyped
103-
n: Untyped
104-
astart: Untyped
105-
total: Untyped
106-
freqs: Untyped
107-
def __init__(self) -> None: ...
108-
def pmf(self, k, n, m) -> Untyped: ...
109-
def cdf(self, k, n, m) -> Untyped: ...
110-
def sf(self, k, n, m) -> Untyped: ...
111-
112-
def ansari(x, y, alternative: str = "two-sided") -> Untyped: ...
113-
114-
class BartlettResult(NamedTuple):
115-
statistic: Untyped
116-
pvalue: Untyped
117-
118-
def bartlett(*samples, axis: int = 0) -> Untyped: ...
119-
120-
class LeveneResult(NamedTuple):
121-
statistic: Untyped
122-
pvalue: Untyped
123-
124-
def levene(*samples, center: str = "median", proportiontocut: float = 0.05) -> Untyped: ...
125-
126-
class FlignerResult(NamedTuple):
127-
statistic: Untyped
128-
pvalue: Untyped
129-
130-
def fligner(*samples, center: str = "median", proportiontocut: float = 0.05) -> Untyped: ...
131-
def mood(x, y, axis: int = 0, alternative: str = "two-sided") -> Untyped: ...
132-
133-
WilcoxonResult: Untyped
134-
127+
def ansari(
128+
x,
129+
y,
130+
alternative: Alternative = "two-sided",
131+
*,
132+
axis: int | None = 0,
133+
nan_policy: NanPolicy = "propagate",
134+
keepdims: bool = False,
135+
) -> Untyped: ...
136+
def bartlett(*samples, axis: int = 0, nan_policy: NanPolicy = "propagate", keepdims: bool = False) -> Untyped: ...
137+
def levene(
138+
*samples,
139+
center: str = "median",
140+
proportiontocut: float = 0.05,
141+
axis: int | None = 0,
142+
nan_policy: NanPolicy = "propagate",
143+
keepdims: bool = False,
144+
) -> Untyped: ...
145+
def fligner(
146+
*samples,
147+
center: str = "median",
148+
proportiontocut: float = 0.05,
149+
axis: int | None = 0,
150+
nan_policy: NanPolicy = "propagate",
151+
keepdims: bool = False,
152+
) -> Untyped: ...
153+
def mood(
154+
x,
155+
y,
156+
axis: int = 0,
157+
alternative: Alternative = "two-sided",
158+
*,
159+
nan_policy: NanPolicy = "propagate",
160+
keepdims: bool = False,
161+
) -> Untyped: ...
135162
def wilcoxon_result_unpacker(res) -> Untyped: ...
136163
def wilcoxon_result_object(statistic, pvalue, zstatistic: Untyped | None = None) -> Untyped: ...
137164
def wilcoxon_outputs(kwds) -> Untyped: ...
@@ -140,37 +167,47 @@ def wilcoxon(
140167
y: Untyped | None = None,
141168
zero_method: str = "wilcox",
142169
correction: bool = False,
143-
alternative: str = "two-sided",
170+
alternative: Alternative = "two-sided",
144171
method: str = "auto",
145172
*,
146173
axis: int = 0,
174+
nan_policy: NanPolicy = "propagate",
175+
keepdims: bool = False,
147176
) -> Untyped: ...
148-
149-
MedianTestResult: Untyped
150-
151177
def median_test(
152178
*samples,
153179
ties: str = "below",
154180
correction: bool = True,
155181
lambda_: int = 1,
156-
nan_policy: str = "propagate",
182+
nan_policy: NanPolicy = "propagate",
183+
) -> Untyped: ...
184+
def circmean(
185+
samples,
186+
high=...,
187+
low: int = 0,
188+
axis: int | None = None,
189+
nan_policy: NanPolicy = "propagate",
190+
*,
191+
keepdims: bool = False,
192+
) -> Untyped: ...
193+
def circvar(
194+
samples,
195+
high=...,
196+
low: int = 0,
197+
axis: int | None = None,
198+
nan_policy: NanPolicy = "propagate",
199+
*,
200+
keepdims: bool = False,
157201
) -> Untyped: ...
158-
def circmean(samples, high=..., low: int = 0, axis: Untyped | None = None, nan_policy: str = "propagate") -> Untyped: ...
159-
def circvar(samples, high=..., low: int = 0, axis: Untyped | None = None, nan_policy: str = "propagate") -> Untyped: ...
160202
def circstd(
161203
samples,
162204
high=...,
163205
low: int = 0,
164-
axis: Untyped | None = None,
165-
nan_policy: str = "propagate",
206+
axis: int | None = None,
207+
nan_policy: NanPolicy = "propagate",
166208
*,
167209
normalize: bool = False,
210+
keepdims: bool = False,
168211
) -> Untyped: ...
169-
170-
class DirectionalStats:
171-
mean_direction: Untyped
172-
mean_resultant_length: Untyped
173-
def __init__(self, mean_direction, mean_resultant_length) -> None: ...
174-
175212
def directional_stats(samples, *, axis: int = 0, normalize: bool = True) -> Untyped: ...
176213
def false_discovery_control(ps, *, axis: int = 0, method: str = "bh") -> Untyped: ...

0 commit comments

Comments
 (0)