-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Use black 19.10b0 #29508
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
Use black 19.10b0 #29508
Changes from 4 commits
5362f81
7689986
6970c0f
e6eac60
a17f582
292bca8
3017af6
13b359f
9efb63d
cb33cab
2e3bff4
c33d574
df35964
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 |
---|---|---|
|
@@ -658,12 +658,16 @@ def test_getslice_tuple(self): | |
dense = np.array([np.nan, 0, 3, 4, 0, 5, np.nan, np.nan, 0]) | ||
|
||
sparse = SparseArray(dense) | ||
res = sparse[4:,] # noqa: E231 | ||
res = sparse[ | ||
4:, | ||
] # noqa: E231 | ||
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 is pretty gnarly. is there an alternative? 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. Seems related to: psf/black#1139 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. Is there a way to turn off formatting for a single line? (something like 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. I was surprised that black doesn't support this - I upvoted -> psf/black#790 I suspect they will revert this in psf/black#1139 |
||
exp = SparseArray(dense[4:,]) # noqa: E231 | ||
tm.assert_sp_array_equal(res, exp) | ||
|
||
sparse = SparseArray(dense, fill_value=0) | ||
res = sparse[4:,] # noqa: E231 | ||
res = sparse[ | ||
4:, | ||
] # noqa: E231 | ||
exp = SparseArray(dense[4:,], fill_value=0) # noqa: E231 | ||
tm.assert_sp_array_equal(res, exp) | ||
|
||
|
@@ -823,11 +827,11 @@ def test_nonzero(self): | |
# Tests regression #21172. | ||
sa = pd.SparseArray([float("nan"), float("nan"), 1, 0, 0, 2, 0, 0, 0, 3, 0, 0]) | ||
expected = np.array([2, 5, 9], dtype=np.int32) | ||
result, = sa.nonzero() | ||
(result,) = sa.nonzero() | ||
tm.assert_numpy_array_equal(expected, result) | ||
|
||
sa = pd.SparseArray([0, 0, 1, 0, 0, 2, 0, 0, 0, 3, 0, 0]) | ||
result, = sa.nonzero() | ||
(result,) = sa.nonzero() | ||
tm.assert_numpy_array_equal(expected, result) | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,14 @@ def test_frame_loc_callable(self): | |
res = df.loc[lambda x: x.A > 2] | ||
tm.assert_frame_equal(res, df.loc[df.A > 2]) | ||
|
||
res = df.loc[lambda x: x.A > 2,] # noqa: E231 | ||
res = df.loc[ | ||
lambda x: x.A > 2, | ||
] # noqa: E231 | ||
tm.assert_frame_equal(res, df.loc[df.A > 2,]) # noqa: E231 | ||
|
||
res = df.loc[lambda x: x.A > 2,] # noqa: E231 | ||
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 doesn't read any better either |
||
res = df.loc[ | ||
lambda x: x.A > 2, | ||
] # noqa: E231 | ||
tm.assert_frame_equal(res, df.loc[df.A > 2,]) # noqa: E231 | ||
|
||
res = df.loc[lambda x: x.B == "b", :] | ||
|
@@ -90,7 +94,9 @@ def test_frame_loc_callable_labels(self): | |
res = df.loc[lambda x: ["A", "C"]] | ||
tm.assert_frame_equal(res, df.loc[["A", "C"]]) | ||
|
||
res = df.loc[lambda x: ["A", "C"],] # noqa: E231 | ||
res = df.loc[ | ||
lambda x: ["A", "C"], | ||
] # noqa: E231 | ||
tm.assert_frame_equal(res, df.loc[["A", "C"],]) # noqa: E231 | ||
|
||
res = df.loc[lambda x: ["A", "C"], :] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,8 @@ def test_index_col_named(all_parsers, with_header): | |
KORD5,19990127, 22:00:00, 21:56:00, -0.5900, 1.7100, 5.1000, 0.0000, 290.0000 | ||
KORD6,19990127, 23:00:00, 22:56:00, -0.5900, 1.7100, 4.6000, 0.0000, 280.0000""" # noqa | ||
header = ( | ||
"ID,date,NominalTime,ActualTime,TDew,TAir,Windspeed,Precip,WindDir\n" | ||
) # noqa | ||
"ID,date,NominalTime,ActualTime,TDew,TAir,Windspeed,Precip,WindDir\n" # noqa | ||
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. I suppose this noqa is also not needed? (was needed before for too long line length, but that is no longer the case) 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. Ahh I missed this - done |
||
) | ||
|
||
if with_header: | ||
data = header + no_header | ||
|
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.
let's make 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.
Sure done here - #29673