Skip to content

Commit 0a144c3

Browse files
committed
🚨 ignore new false-positive pyright errors
1 parent 8ae167b commit 0a144c3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

‎scipy-stubs/stats/_probability_distribution.pyi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,25 @@ _Self3: TypeAlias = _Self[_XT, tuple[int, int, int]]
133133
_Self1_: TypeAlias = _Self[_XT, onp.AtLeast1D]
134134

135135
# TODO(jorenham): Merge into ContinuousDistribution?
136+
# NOTE: the incompatible method overrides appear to be pyright-only false positives
136137
@type_check_only
137138
class _BaseDistribution(_ProbabilityDistribution[_XT_co], Generic[_XT_co, _ShapeT0_co]):
138139
@overload
139140
def support(self: _Self0[_XT], /) -> _Tuple2[_XT]: ...
140141
@overload
141-
def support(self: _Self[_XT, _ShapeT], /) -> _Tuple2[onp.Array[_ShapeT, _XT]]: ...
142+
def support(self: _Self[_XT, _ShapeT], /) -> _Tuple2[onp.Array[_ShapeT, _XT]]: ... # pyright: ignore[reportIncompatibleMethodOverride]
142143

143144
#
144145
@overload
145146
def median(self: _Self0[_XT], /, *, method: _MedianMethod = None) -> _XT: ...
146147
@overload
147-
def median(self: _Self[_XT, _ShapeT], /, *, method: _MedianMethod = None) -> onp.Array[_ShapeT, _XT]: ...
148+
def median(self: _Self[_XT, _ShapeT], /, *, method: _MedianMethod = None) -> onp.Array[_ShapeT, _XT]: ... # pyright: ignore[reportIncompatibleMethodOverride]
148149

149150
#
150151
@overload
151152
def mode(self: _Self0[_XT], /, *, method: _ModeMethod = None) -> _XT: ...
152153
@overload
153-
def mode(self: _Self[_XT, _ShapeT], /, *, method: _ModeMethod = None) -> onp.Array[_ShapeT, _XT]: ...
154+
def mode(self: _Self[_XT, _ShapeT], /, *, method: _ModeMethod = None) -> onp.Array[_ShapeT, _XT]: ... # pyright: ignore[reportIncompatibleMethodOverride]
154155

155156
#
156157
@overload
@@ -205,25 +206,25 @@ class _BaseDistribution(_ProbabilityDistribution[_XT_co], Generic[_XT_co, _Shape
205206
@overload
206207
def mean(self: _Self0[_XT], /, *, method: _RMomentMethod = None) -> _XT: ...
207208
@overload
208-
def mean(self: _Self[_XT, _ShapeT], /, *, method: _RMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ...
209+
def mean(self: _Self[_XT, _ShapeT], /, *, method: _RMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ... # pyright: ignore[reportIncompatibleMethodOverride]
209210

210211
#
211212
@overload
212213
def variance(self: _Self0[_XT], /, *, method: _CMomentMethod = None) -> _XT: ...
213214
@overload
214-
def variance(self: _Self[_XT, _ShapeT], /, *, method: _CMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ...
215+
def variance(self: _Self[_XT, _ShapeT], /, *, method: _CMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ... # pyright: ignore[reportIncompatibleMethodOverride]
215216

216217
#
217218
@overload
218219
def standard_deviation(self: _Self0[_XT], /, *, method: _CMomentMethod = None) -> _XT: ...
219220
@overload
220-
def standard_deviation(self: _Self[_XT, _ShapeT], /, *, method: _CMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ...
221+
def standard_deviation(self: _Self[_XT, _ShapeT], /, *, method: _CMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ... # pyright: ignore[reportIncompatibleMethodOverride]
221222

222223
#
223224
@overload
224225
def skewness(self: _Self0[_XT], /, *, method: _SMomentMethod = None) -> _XT: ...
225226
@overload
226-
def skewness(self: _Self[_XT, _ShapeT], /, *, method: _SMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ...
227+
def skewness(self: _Self[_XT, _ShapeT], /, *, method: _SMomentMethod = None) -> onp.ArrayND[_XT, _ShapeT]: ... # pyright: ignore[reportIncompatibleMethodOverride]
227228

228229
#
229230
@overload
@@ -235,7 +236,7 @@ class _BaseDistribution(_ProbabilityDistribution[_XT_co], Generic[_XT_co, _Shape
235236
convention: _KurtosisConvention = "non-excess",
236237
) -> _XT: ...
237238
@overload
238-
def kurtosis(
239+
def kurtosis( # pyright: ignore[reportIncompatibleMethodOverride]
239240
self: _Self[_XT, _ShapeT],
240241
/,
241242
*,
@@ -291,7 +292,7 @@ class _BaseDistribution(_ProbabilityDistribution[_XT_co], Generic[_XT_co, _Shape
291292
method: _SMomentMethod = None,
292293
) -> _FloatND[_ShapeT]: ...
293294
@overload
294-
def moment( # pyright: ignore[reportIncompatibleMethodOverride] # pyright false positive bug
295+
def moment( # pyright: ignore[reportIncompatibleMethodOverride]
295296
self: _Self[Any, _ShapeT],
296297
/,
297298
order: onp.ToInt = 1,

0 commit comments

Comments
 (0)