Skip to content

Commit 4ab7aed

Browse files
authored
🎨 fix and run the FixTrailingComma codemod (#397)
2 parents c95437a + 2cc995a commit 4ab7aed

File tree

5 files changed

+434
-75
lines changed

5 files changed

+434
-75
lines changed

‎codegen/mods.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ class FixTrailingComma(_BaseMod):
101101

102102
@override
103103
def leave_FunctionDef(self, /, original_node: cst.FunctionDef, updated_node: cst.FunctionDef) -> cst.FunctionDef:
104-
params = updated_node.params.params
104+
params_node = updated_node.params
105+
params = *params_node.posonly_params, *params_node.params, *params_node.kwonly_params
105106

106107
if (
107108
# the parameters start on a new line

‎scipy-stubs/interpolate/_bary_rational.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
4444
weights: onp.Array1D[_SCT_co]
4545

4646
@property
47-
def support_points(self) -> onp.Array1D[_SCT_co]: ...
47+
def support_points(self, /) -> onp.Array1D[_SCT_co]: ...
4848
@property
49-
def support_values(self) -> onp.Array1D[_SCT_co]: ...
49+
def support_values(self, /) -> onp.Array1D[_SCT_co]: ...
5050

5151
#
5252
@overload
5353
def __init__(
5454
self,
55+
/,
5556
x: onp.CanArrayND[_SCT_co] | Sequence[_SCT_co],
5657
y: onp.CanArrayND[_SCT_co | _ToFloat16] | Sequence[_SCT_co | _ToFloat16],
5758
*,
@@ -63,6 +64,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
6364
@overload
6465
def __init__(
6566
self: AAA[np.float64],
67+
/,
6668
x: Sequence[float],
6769
y: onp.CanArrayND[_ToFloat64] | Sequence[float | _ToFloat64],
6870
*,
@@ -74,6 +76,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
7476
@overload
7577
def __init__(
7678
self: AAA[np.float64],
79+
/,
7780
x: onp.CanArrayND[_ToFloat64] | Sequence[float | _ToFloat64],
7881
y: Sequence[float],
7982
*,
@@ -85,6 +88,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
8588
@overload
8689
def __init__(
8790
self: AAA[np.complex128],
91+
/,
8892
x: Sequence[complex],
8993
y: onp.CanArrayND[_ToFloat64] | Sequence[complex | _ToComplex128],
9094
*,
@@ -96,6 +100,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
96100
@overload
97101
def __init__(
98102
self: AAA[np.complex128],
103+
/,
99104
x: onp.CanArrayND[_ToComplex128] | Sequence[complex | _ToComplex128],
100105
y: Sequence[complex],
101106
*,

‎scipy-stubs/stats/_distribution_infrastructure.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ class ContinuousDistribution(_BaseDistribution[_FloatT_co, _ShapeT_co], Generic[
341341
def reset_cache(self, /) -> None: ...
342342
def plot(
343343
self,
344+
/,
344345
x: _PlotQuantity = "x",
345346
y: _PlotQuantity = "pdf",
346347
*,

0 commit comments

Comments
 (0)