Skip to content

Commit 65df11b

Browse files
committed
Remove bogus statements from type stubs
1 parent 735c2f9 commit 65df11b

File tree

28 files changed

+11
-580
lines changed

28 files changed

+11
-580
lines changed

stubs/matplotlib/transforms.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ class TransformNode:
1616
is_bbox = ...
1717
pass_through = ...
1818
def __init__(self, shorthand_name: str = ...) -> None: ...
19-
if DEBUG:
20-
def __str__(self) -> str: ...
21-
2219
def __getstate__(self): ...
2320
def __setstate__(self, data_dict): ...
2421
def __copy__(self): ...
@@ -29,7 +26,6 @@ class TransformNode:
2926
class BboxBase(TransformNode):
3027
is_bbox = ...
3128
is_affine = ...
32-
if DEBUG: ...
3329

3430
def frozen(self): ...
3531
def __array__(self, *args, **kwargs): ...

stubs/networkx/algorithms/isomorphism/matchhelpers.pyi

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ categorical_edge_match = ...
3131
def categorical_multiedge_match(attr: str | ArrayLike, default): ...
3232

3333
# Docstrings for categorical functions.
34-
categorical_node_match.__doc__ = ...
35-
categorical_edge_match.__doc__ = ...
3634
tmpdoc = ...
37-
tmpdoc = ...
38-
categorical_multiedge_match.__doc__ = ...
3935

4036
numerical_doc: str = ...
4137

@@ -56,11 +52,7 @@ def numerical_multiedge_match(
5652
): ...
5753

5854
# Docstrings for numerical functions.
59-
numerical_node_match.__doc__ = ...
60-
numerical_edge_match.__doc__ = ...
61-
tmpdoc = ...
6255
tmpdoc = ...
63-
numerical_multiedge_match.__doc__ = ...
6456

6557
generic_doc: str = ...
6658

@@ -69,7 +61,3 @@ def generic_node_match(attr: str | ArrayLike, default, op: ArrayLike | Callable)
6961
generic_edge_match = ...
7062

7163
def generic_multiedge_match(attr: str | ArrayLike, default, op: ArrayLike | Callable): ...
72-
73-
# Docstrings for numerical functions.
74-
generic_node_match.__doc__ = ...
75-
generic_edge_match.__doc__ = ...

stubs/networkx/algorithms/tree/branchings.pyi

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,6 @@ docstring_branching: str = ...
112112

113113
docstring_arborescence = ...
114114

115-
maximum_branching.__doc__ = ...
116-
117-
minimum_branching.__doc__ = ...
118-
119-
maximum_spanning_arborescence.__doc__ = ...
120-
121-
minimum_spanning_arborescence.__doc__ = ...
122-
123115
class ArborescenceIterator:
124116
...
125117

stubs/networkx/classes/digraph.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class DiGraph(Graph):
5252
@cached_property
5353
def out_edges(self) -> OutEdgeView: ...
5454

55-
out_edges.__doc__ = ...
56-
5755
@cached_property
5856
def in_edges(self) -> InEdgeView: ...
5957
@cached_property

stubs/networkx/classes/multidigraph.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class MultiDiGraph(MultiGraph, DiGraph):
3434
@cached_property
3535
def out_edges(self) -> OutMultiEdgeView: ...
3636

37-
out_edges.__doc__ = ...
38-
3937
@cached_property
4038
def in_edges(self) -> InMultiEdgeView: ...
4139
@cached_property

stubs/networkx/readwrite/gexf.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ def generate_gexf(G: Graph, encoding="utf-8", prettyprint=True, version="1.2draf
1212
def read_gexf(path, node_type=None, relabel=False, version="1.2draft"): ...
1313

1414
class GEXF:
15-
versions: dict = ...
16-
d: dict = ...
17-
versions["1.1draft"] = ...
18-
d: dict = ...
19-
versions["1.2draft"] = ...
15+
versions: dict
2016

2117
def construct_types(self): ...
2218

stubs/skimage/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ from ._shared import lazy as lazy
66
from ._shared.tester import PytestTester as PytestTester # noqa
77
from ._shared.version_requirements import ensure_python_version as ensure_python_version
88

9-
__getattr__, __lazy_dir__, _ = ...
9+
__getattr__= ...
10+
__lazy_dir__= ...
1011

1112
def __dir__(): ...
1213

stubs/skimage/data/__init__.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from .._shared import lazy as lazy
22

3-
__getattr__, __dir__, __all__ = ...
3+
__getattr__ = ...
4+
__dir__ = ...
5+
__all__ = ... # pyright: ignore[reportUnsupportedDunderAll] # TODO

stubs/skimage/data/_fetchers.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ skimage_distribution_dir = ...
1515
def _has_hash(path, expected_hash): ...
1616
def create_image_fetcher(): ...
1717

18-
image_fetcher, data_dir = ...
18+
image_fetcher = ...
19+
data_dir = ...
1920

2021
def _skip_pytest_case_requiring_pooch(data_filename): ...
2122
def _fetch(data_filename): ...

stubs/sklearn/cross_decomposition/_pls.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ class PLSRegression(_PLS):
7070
x_weights_: ndarray = ...
7171

7272
_parameter_constraints: ClassVar[dict] = ...
73-
for param in ("deflation_mode", "mode", "algorithm"):
74-
pass
7573

7674
# This implementation provides the same results that 3 PLS packages
7775
# provided in the R language (R-project):
@@ -104,8 +102,6 @@ class PLSCanonical(_PLS):
104102
x_weights_: ndarray = ...
105103

106104
_parameter_constraints: ClassVar[dict] = ...
107-
for param in ("deflation_mode", "mode"):
108-
pass
109105

110106
# This implementation provides the same results that the "plspm" package
111107
# provided in the R language (R-project), using the function plsca(X, Y).
@@ -140,8 +136,6 @@ class CCA(_PLS):
140136
x_weights_: ndarray = ...
141137

142138
_parameter_constraints: ClassVar[dict] = ...
143-
for param in ("deflation_mode", "mode", "algorithm"):
144-
pass
145139

146140
def __init__(
147141
self,

stubs/sklearn/ensemble/_forest.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,6 @@ class RandomTreesEmbedding(TransformerMixin, BaseForest):
285285
estimator_: ExtraTreeRegressor = ...
286286

287287
_parameter_constraints: ClassVar[dict] = ...
288-
for param in ("max_features", "ccp_alpha", "splitter"):
289-
pass
290288

291289
criterion: ClassVar[str] = ...
292290
max_features: ClassVar[int] = ...

stubs/sklearn/linear_model/_coordinate_descent.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ class MultiTaskElasticNet(Lasso):
264264
intercept_: ndarray = ...
265265

266266
_parameter_constraints: ClassVar[dict] = ...
267-
for param in ("precompute", "positive"):
268-
pass
269267

270268
def __init__(
271269
self,

stubs/sklearn/linear_model/_least_angle.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ class LarsCV(Lars):
147147

148148
_parameter_constraints: ClassVar[dict] = ...
149149

150-
for parameter in ["n_nonzero_coefs", "jitter", "fit_path", "random_state"]:
151-
pass
152-
153150
method: ClassVar[str] = ...
154151

155152
def __init__(
@@ -214,9 +211,6 @@ class LassoLarsIC(LassoLars):
214211

215212
_parameter_constraints: ClassVar[dict] = ...
216213

217-
for parameter in ["jitter", "fit_path", "alpha", "random_state"]:
218-
pass
219-
220214
def __init__(
221215
self,
222216
criterion: Literal["aic", "bic", "aic"] = "aic",

stubs/sklearn/linear_model/_logistic.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ class LogisticRegressionCV(LogisticRegression, LinearClassifierMixin, BaseEstima
100100

101101
_parameter_constraints: ClassVar[dict] = ...
102102

103-
for param in ["C", "warm_start", "l1_ratio"]:
104-
pass
105-
106103
def __init__(
107104
self,
108105
*,

stubs/sklearn/linear_model/_ridge.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ class RidgeClassifierCV(_RidgeClassifierMixin, _BaseRidgeCV):
248248
cv_values_: ndarray = ...
249249

250250
_parameter_constraints: ClassVar[dict] = ...
251-
for param in ("gcv_mode", "alpha_per_target"):
252-
pass
253251

254252
def __init__(
255253
self,

stubs/sklearn/svm/_base.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ class BaseLibSVM(BaseEstimator, metaclass=ABCMeta):
7070

7171
class BaseSVC(ClassifierMixin, BaseLibSVM, metaclass=ABCMeta):
7272
_parameter_constraints: ClassVar[dict] = ...
73-
for unused_param in ["epsilon", "nu"]:
74-
pass
7573

7674
@abstractmethod
7775
def __init__(

stubs/sklearn/svm/_classes.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ class SVR(RegressorMixin, BaseLibSVM):
177177
_impl: ClassVar[str] = ...
178178

179179
_parameter_constraints: ClassVar[dict] = ...
180-
for unused_param in ["class_weight", "nu", "probability", "random_state"]:
181-
pass
182180

183181
def __init__(
184182
self,
@@ -217,8 +215,6 @@ class NuSVR(RegressorMixin, BaseLibSVM):
217215
_impl: ClassVar[str] = ...
218216

219217
_parameter_constraints: ClassVar[dict] = ...
220-
for unused_param in ["class_weight", "epsilon", "probability", "random_state"]:
221-
pass
222218

223219
def __init__(
224220
self,
@@ -258,8 +254,6 @@ class OneClassSVM(OutlierMixin, BaseLibSVM):
258254
_impl: ClassVar[str] = ...
259255

260256
_parameter_constraints: ClassVar[dict] = ...
261-
for unused_param in ["C", "class_weight", "epsilon", "probability", "random_state"]:
262-
pass
263257

264258
def __init__(
265259
self,

stubs/sympy-stubs/__init__.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,9 +921,7 @@ from sympy.utilities import (
921921
xthreaded,
922922
)
923923

924-
if sys.version_info < (3, 8): ...
925-
if "dev" in __version__:
926-
def enable_warnings() -> None: ...
924+
def enable_warnings() -> None: ...
927925

928926
SYMPY_DEBUG: bool = ...
929927
test = ...

stubs/sympy-stubs/core/cache.pyi

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ print_cache = ...
99
clear_cache = ...
1010
USE_CACHE = ...
1111
scs = ...
12-
if scs.lower() == "none":
13-
SYMPY_CACHE_SIZE = ...
14-
else:
15-
SYMPY_CACHE_SIZE = ...
16-
if USE_CACHE == "no":
17-
cacheit = ...
18-
else:
19-
cacheit = ...
12+
SYMPY_CACHE_SIZE = ...
13+
cacheit = ...
2014

2115
def cached_property(func) -> property: ...
2216
def lazy_function(module: str, name: str) -> Callable:

stubs/sympy-stubs/core/relational.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class GreaterThan(_Greater):
100100
Ge = GreaterThan
101101

102102
class LessThan(_Less):
103-
__doc__ = ...
104103
__slots__ = ...
105104
rel_op = ...
106105
@property
@@ -109,7 +108,6 @@ class LessThan(_Less):
109108
Le = LessThan
110109

111110
class StrictGreaterThan(_Greater):
112-
__doc__ = ...
113111
__slots__ = ...
114112
rel_op = ...
115113
@property
@@ -118,7 +116,6 @@ class StrictGreaterThan(_Greater):
118116
Gt = StrictGreaterThan
119117

120118
class StrictLessThan(_Less):
121-
__doc__ = ...
122119
__slots__ = ...
123120
rel_op = ...
124121
@property

stubs/sympy-stubs/physics/control/control_plots.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ __all__ = [
1717
]
1818
matplotlib = ...
1919
numpy = ...
20-
if matplotlib:
21-
plt = ...
22-
if numpy:
23-
np = ...
2420

2521
def pole_zero_numerical_data(system) -> tuple[Any, Any]: ...
2622
def pole_zero_plot(

stubs/sympy-stubs/plotting/pygletplot/managed_window.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ class ManagedWindow:
1010
def update(self, dt) -> None: ...
1111
def draw(self) -> None: ...
1212

13-
if __name__ == "__main__": ...

stubs/sympy-stubs/polys/numberfields/galois_resolvents.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,3 @@ def define_resolvents() -> dict[
2626
]: ...
2727
def generate_lambda_lookup(verbose=..., trial_run=...) -> str: ...
2828
def get_resolvent_by_lookup(T, number) -> list[Any]: ...
29-
30-
if __name__ == "__main__":
31-
verbose = ...
32-
trial_run = ...
33-
table = ...

stubs/sympy-stubs/simplify/fu.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def TR22(rv, max=..., pow=...): ...
2929
def TRpower(rv): ...
3030
def L(rv): ...
3131

32-
if SYMPY_DEBUG: ...
3332
CTR1 = ...
3433
CTR2 = ...
3534
CTR3 = ...

stubs/sympy-stubs/testing/runtests.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class Skipped(Exception): ...
1313
class TimeOutError(Exception): ...
1414
class DependencyError(Exception): ...
1515

16-
if IS_WINDOWS: ...
1716

1817
def convert_to_native_paths(lst) -> list[Any]: ...
1918
def get_sympy_dir() -> str: ...

0 commit comments

Comments
 (0)