-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Line too long: Attribute chain on right-hand side #1525
Comments
To add on this, I have a similar case, where this: da_outliers_loc = (
(ds.precipitation > ds_qt.precipitation.sel(quantile=qt_values[0])) &
(ds.temperature > ds_qt.temperature.sel(quantile=qt_values[1]))
) is formatted like this: (tested in the black playground) da_outliers_loc = (
ds.precipitation > ds_qt.precipitation.sel(quantile=qt_values[0])
) & (ds.temperature > ds_qt.temperature.sel(quantile=qt_values[1])) which is arguably uglier. |
Here's another example (taken from a colleagues' code - I renamed variables): def outerfunc1(something):
def outerfunc2(something_else):
def innerfunc(another_thing):
for row in another_thing.itertuples():
try:
this_is_a_very_long_variablename = another_thing.sample(n=10)
this_is_a_very_long_variablename = this_is_a_very_long_variablename.loc[
this_is_a_very_long_variablename.a_pandas_long_column_nam.cumsum()
<= 10
]
except Exception:
raise ValueError("something") could be reformatted as def outerfunc1(something):
def outerfunc2(something_else):
def innerfunc(another_thing):
for row in another_thing.itertuples():
try:
this_is_a_very_long_variablename = another_thing.sample(n=10)
this_is_a_very_long_variablename = (
this_is_a_very_long_variablename.loc[
this_is_a_very_long_variablename.a_pandas_long_column_nam
.cumsum()
<= 10
]
)
except Exception:
raise ValueError("something") |
Triaging comments:
|
Should I create a new issue for that? |
I think #510 is enough and this one doesn't need to be kept open. |
Issue code (assume max line length <= 80):
Black indents this as
However, that first line still violates the line length limit.
Suggestion: use parenthesis:
The text was updated successfully, but these errors were encountered: