-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Enable and run black on examples #20502
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
Conversation
plt.scatter( | ||
species.pts_train["dd long"], | ||
species.pts_train["dd lat"], | ||
s=2 ** 2, | ||
c="black", | ||
marker="^", | ||
label="train", | ||
) | ||
plt.scatter( | ||
species.pts_test["dd long"], | ||
species.pts_test["dd lat"], | ||
s=2 ** 2, | ||
c="black", | ||
marker="x", | ||
label="test", | ||
) |
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.
This is an example of code that became more "vertical".
Just a side note: I am using pre-commit and configure as mentioned in our documentation and it will format the example as well. |
I like the consistency of using black everywhere as long as it allows to keep import statements in non-top code cells on notebook-style examples. Indeed I prefer importing modules the first time they are needed in such tutorial style examples. Fortunately this is fine with black. |
Before considering merging this, we should wait for the 88 vs 79 vote. |
546ad63
to
26f2233
Compare
Now that the vote is done, I rebased and updated this PR with another black run. |
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.
LGTM from my side.
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.
LGTM, thanks @thomasjpfan.
I personally "vertical code" relevant because it makes the code both easier to read (parameter lists are presented as list) and to maintain as changes on a line have a finer/atomic semantic precision/granularity.
Merged! |
This PR is to see what the examples look like by running
black
. I went through a random selection of the examples and I think I am okay with the result. Some function calls are a little more vertical, but I think that is okay?I have seen @glemaitre do this for his examples PR and I am a little more convinced that running
black
on examples is readable.