-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
STY: Use ruff to format docstrings #56863
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
Changes from 9 commits
d7fbb3e
dacdd0b
77dc845
255b16c
15a52fd
d5baf82
d004398
6386676
78aa82d
e97155c
a902f8e
359736e
2ea6780
b416125
5dcbce8
df03285
f33d435
23e5d93
b40d961
65ac7cc
3434878
65c4c33
6fbe5ca
b09a550
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1798,14 +1798,14 @@ def normalize_keyword_aggregation( | |
|
||
|
||
def _make_unique_kwarg_list( | ||
seq: Sequence[tuple[Any, Any]] | ||
seq: Sequence[tuple[Any, Any]], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this isn't a docstring. did ruff change this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I believe from ruff's upgrade to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great. |
||
) -> Sequence[tuple[Any, Any]]: | ||
""" | ||
Uniquify aggfunc name of the pairs in the order list | ||
|
||
Examples: | ||
-------- | ||
>>> kwarg_list = [('a', '<lambda>'), ('a', '<lambda>'), ('b', '<lambda>')] | ||
>>> kwarg_list = [("a", "<lambda>"), ("a", "<lambda>"), ("b", "<lambda>")] | ||
>>> _make_unique_kwarg_list(kwarg_list) | ||
[('a', '<lambda>_0'), ('a', '<lambda>_1'), ('b', '<lambda>')] | ||
""" | ||
|
@@ -1837,7 +1837,7 @@ def relabel_result( | |
>>> from pandas.core.apply import relabel_result | ||
>>> result = pd.DataFrame( | ||
... {"A": [np.nan, 2, np.nan], "C": [6, np.nan, np.nan], "B": [np.nan, 4, 2.5]}, | ||
... index=["max", "mean", "min"] | ||
... index=["max", "mean", "min"], | ||
... ) | ||
>>> funcs = {"A": ["max"], "C": ["max"], "B": ["mean", "min"]} | ||
>>> columns = ("foo", "aab", "bar", "dat") | ||
|
@@ -1976,7 +1976,7 @@ def maybe_mangle_lambdas(agg_spec: Any) -> Any: | |
|
||
Examples | ||
-------- | ||
>>> maybe_mangle_lambdas('sum') | ||
>>> maybe_mangle_lambdas("sum") | ||
'sum' | ||
>>> maybe_mangle_lambdas([lambda: 1, lambda: 2]) # doctest: +SKIP | ||
[<function __main__.<lambda_0>, | ||
|
@@ -2021,7 +2021,7 @@ def validate_func_kwargs( | |
|
||
Examples | ||
-------- | ||
>>> validate_func_kwargs({'one': 'min', 'two': 'max'}) | ||
>>> validate_func_kwargs({"one": "min", "two": "max"}) | ||
(['one', 'two'], ['min', 'max']) | ||
""" | ||
tuple_given_message = "func is expected but received {} in **kwargs." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure this can be removed?
ruff
only works statically, so only checks generated docstrings - any docstring with a substitution won't be checked. that's whatvalidate_docstrings.py
doesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point. Yeah none of the dynamic docstrings were able to get formatted so I'll revert this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more reason to get rid of dynamic docstrings 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big +1 to remove them!