-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix some lgtm convention alerts #11963
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
ec80711
to
286f3af
Compare
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.
anyone can merge pending ci
Any opinions on the |
Hah, I always do that z = x*0 + z |
👍 to |
286f3af
to
f8136f3
Compare
Changed to
That's almost the same 😄 The results differ if x contains nan values. Also |
@jklymak that one's cute |
…963-on-v3.0.x Backport PR #11963 on branch v3.0.x
@@ -128,8 +128,8 @@ | |||
"/Network/Library/Fonts/", | |||
"/System/Library/Fonts/", | |||
# fonts installed via MacPorts | |||
"/opt/local/share/fonts" | |||
"" | |||
"/opt/local/share/fonts", |
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 comma changed semantics from implicit string concatenation to a new empty string in the list.
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 correcting a bug, we want to pick up fonts in the current directory.
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.
Only on OSX, not windows or Linux?
Doesn't seem like something we'd want.
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.
Hmm, that seems like a bug that it is missing in the other cases.
On the other hand, this recursion issue seems to be causing grief for many people and as this is cached, using the cwd is also a bit off (as the next time you read the cache your cwd is different).
On balance, I think my initial reaction to this was wrong.
While including the cwd makes sense at first glance, it does not because a) the result is cached so the next time your cwd will be different but we will not find those files b) the time it takes to search all the files is causing prolems c) the other 2 platforms do not do this The comma was introduced to fix what looked like a bug (implicit string concatenation instead of adding the empty string to the list) in matplotlib#11963. Original code come in via 4799341 in 2011. closes matplotlib#12176
While including the cwd makes sense at first glance, it does not because a) the result is cached so the next time your cwd will be different but we will not find those files b) the time it takes to search all the files is causing prolems c) the other 2 platforms do not do this The comma was introduced to fix what looked like a bug (implicit string concatenation instead of adding the empty string to the list) in matplotlib#11963. Original code come in via 4799341 in 2011. closes matplotlib#12176
PR Summary
zs = [float(zs)] * len(xs)
is just rewritten to make the intention more clear. Can we make zs a numpy array instead of a list here? If so, that can be further simplified tonp.full_like(xs, fill_value=float(zs))
.