Repository navigation
Fix some lgtm convention alerts - #11963
Conversation
ec80711 to
286f3af
Compare
anntzer
left a comment
There was a problem hiding this comment.
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
| # fonts installed via MacPorts | ||
| "/opt/local/share/fonts" | ||
| "" | ||
| "/opt/local/share/fonts", |
There was a problem hiding this comment.
This comma changed semantics from implicit string concatenation to a new empty string in the list.
There was a problem hiding this comment.
This is correcting a bug, we want to pick up fonts in the current directory.
There was a problem hiding this comment.
Only on OSX, not windows or Linux?
Doesn't seem like something we'd want.
There was a problem hiding this comment.
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)).