fixed bug 6028 #6073

Merged
merged 4 commits into from Mar 6, 2016

Conversation

Projects
None yet
5 participants
Contributor

crazyo commented Feb 29, 2016

The problem was that hyphen-minus was converted to minus signs without differentiating those in math expressions and those in texts. I fixed it by adding an optional parameter nonMath so that hyphens in texts won't be converted.

@crazyo crazyo fixed bug 6028
ad8533c

mdboom added the needs_review label Feb 29, 2016

@crazyo crazyo fixed a bug in previous PR
0c14522
Owner

mdboom commented Feb 29, 2016

Thanks for investigating the issue.

I think actually, for the non-math context, get_unicode_index should always return ord(symbol) and do nothing else. The fact that it could fall through to return tex2uni[symbol.strip("\\")] is also a bug. So maybe add:

if non_math:
    return ord(symbol)

to the top and leave the rest of get_unicode_index as is.

Also, to be PEP8-compliant, the new keyword argument should be spelled non_math, not nonMath.

@crazyo crazyo made change to PR according to comments
89f1fae
Contributor

crazyo commented Feb 29, 2016

@mdboom Hi thank you for your response. I have made changes accordingly :-)

Owner

mdboom commented Feb 29, 2016

👍 from me, but I'll leave this up for a little while in case others have comments.

Member

zblz commented Mar 1, 2016

Looks good to me, even though the code might be clearer if a math flag instead of non_math was used. Double negatives like non_math=False make understanding the code a little bit more difficult.

@crazyo crazyo changed non_math to math according to comments on bug 6028
707c8b3
Contributor

crazyo commented Mar 1, 2016

@zblz I've made the changes :-)

@tacaswell tacaswell added a commit that referenced this pull request Mar 6, 2016

@tacaswell tacaswell Merge pull request #6073 from crazyo/master
fixed #6028
85089a1

@tacaswell tacaswell merged commit 85089a1 into matplotlib:master Mar 6, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

tacaswell removed the needs_review label Mar 6, 2016

Owner

tacaswell commented Mar 6, 2016

@crazyo Can you open a new PR to add a simple test for this?

@tacaswell tacaswell added a commit that referenced this pull request Mar 6, 2016

@tacaswell tacaswell Merge pull request #6073 from crazyo/master
fixed #6028
ebfbc4a
Owner

tacaswell commented Mar 6, 2016

backported to v2.x as ebfbc4a

QuLogic added the text label Mar 7, 2016

Contributor

crazyo commented Mar 7, 2016

yes, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment