Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 fix and run the FixTrailingComma codemod #397

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion codegen/mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class FixTrailingComma(_BaseMod):

@override
def leave_FunctionDef(self, /, original_node: cst.FunctionDef, updated_node: cst.FunctionDef) -> cst.FunctionDef:
params = updated_node.params.params
params_node = updated_node.params
params = *params_node.posonly_params, *params_node.params, *params_node.kwonly_params

if (
# the parameters start on a new line
Expand Down
9 changes: 7 additions & 2 deletions scipy-stubs/interpolate/_bary_rational.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
weights: onp.Array1D[_SCT_co]

@property
def support_points(self) -> onp.Array1D[_SCT_co]: ...
def support_points(self, /) -> onp.Array1D[_SCT_co]: ...
@property
def support_values(self) -> onp.Array1D[_SCT_co]: ...
def support_values(self, /) -> onp.Array1D[_SCT_co]: ...

#
@overload
def __init__(
self,
/,
x: onp.CanArrayND[_SCT_co] | Sequence[_SCT_co],
y: onp.CanArrayND[_SCT_co | _ToFloat16] | Sequence[_SCT_co | _ToFloat16],
*,
Expand All @@ -63,6 +64,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
@overload
def __init__(
self: AAA[np.float64],
/,
x: Sequence[float],
y: onp.CanArrayND[_ToFloat64] | Sequence[float | _ToFloat64],
*,
Expand All @@ -74,6 +76,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
@overload
def __init__(
self: AAA[np.float64],
/,
x: onp.CanArrayND[_ToFloat64] | Sequence[float | _ToFloat64],
y: Sequence[float],
*,
Expand All @@ -85,6 +88,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
@overload
def __init__(
self: AAA[np.complex128],
/,
x: Sequence[complex],
y: onp.CanArrayND[_ToFloat64] | Sequence[complex | _ToComplex128],
*,
Expand All @@ -96,6 +100,7 @@ class AAA(_BarycentricRational[_SCT_co, tuple[int]], Generic[_SCT_co]):
@overload
def __init__(
self: AAA[np.complex128],
/,
x: onp.CanArrayND[_ToComplex128] | Sequence[complex | _ToComplex128],
y: Sequence[complex],
*,
Expand Down
1 change: 1 addition & 0 deletions scipy-stubs/stats/_distribution_infrastructure.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ class ContinuousDistribution(_BaseDistribution[_FloatT_co, _ShapeT_co], Generic[
def reset_cache(self, /) -> None: ...
def plot(
self,
/,
x: _PlotQuantity = "x",
y: _PlotQuantity = "pdf",
*,
Expand Down
Loading
Loading