Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Avoid comparing numpy array to strings in two places #7658
Conversation
efiring
requested changes
Dec 21, 2016
Apart from the suggested change in implementation, this is good.
| @@ -1282,7 +1282,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None): | ||
| etc. | ||
| ===== ===================== | ||
| """ | ||
| - if aspect in ('equal', 'auto'): | ||
| + if isinstance(aspect, str) and aspect in ('equal', 'auto'): |
efiring
Dec 21, 2016
Owner
It might be better to use cbook.is_string_like instead of is_instance. Or at least six.string_types in place of str.
dstansby
changed the title from
Check aspect to avoid comparing numpy array to tuple of strings to Avoid comparing numpy array to strings in two places
Dec 22, 2016
|
There was another similar warning coming up in in #5806 that I have also fixed. |
efiring
changed the title from
Avoid comparing numpy array to strings in two places to [MRG+1] Avoid comparing numpy array to strings in two places
Dec 22, 2016
|
Test failures are unrelated (common random failures). |
NelleV
changed the title from
[MRG+1] Avoid comparing numpy array to strings in two places to [MRG+2] Avoid comparing numpy array to strings in two places
Dec 22, 2016
|
LGTM |
QuLogic
changed the title from
[MRG+2] Avoid comparing numpy array to strings in two places to Avoid comparing numpy array to strings in two places
Dec 22, 2016
QuLogic
merged commit b8568f9
into matplotlib:master
Dec 22, 2016
QuLogic
added this to the
2.1 (next point release)
milestone
Dec 22, 2016
dstansby
deleted the
dstansby:aspect-array-warning branch
Dec 22, 2016
This was referenced Mar 1, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dstansby commentedDec 21, 2016
Fixes #5806