Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
shims for categorical support for numpy < 1.8#8591
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
We already require at least numpy 1.7. It may be better to just jump the minimum version to 1.8. For example, the oldest Ubuntu still not EOL'd is trusty LTS, which has 1.8.1 (https://wiki.ubuntu.com/Releases andhttp://packages.ubuntu.com/trusty/python/python-numpy). |
story645 commentedMay 8, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm fine with whichever. This supports down to 1.6 only because I couldn't reproduce the bug on 1.7. (And so don't know if the unicode issues appear with 1.7...) Also dunno what codecov is mad about |
my guess is that by removing the decorator definition + applications you reduced the number of lines (and covered lines) in the tests files (which out changing the number of not-covered lines) so the fraction of covered lines went down slightly. |
lib/matplotlib/category.py Outdated
import collections | ||
def shim_array(data): |
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.
might be better to do this as
ifLooseVersion(np.__version__)<LooseVersion('1.8.0'):defshim_array(data): ...else:defshim_array(data):returnnp.array(data,dtype=np.unicode)
so we only do the version check at import time.
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.
Left one comment (to avoid frequently checking the numpy version, but do not think it is worth holding the PR)
Updated based@tacaswell's comments. Can this be closed out? |
Uh oh!
There was an error while loading.Please reload this page.
Matplotlib doesn't render unicode strings with numpy below 1.7 and numpy below 1.8 is buggy with mixed type arrays, truncating strings to the size of the smallest string in the mixed type array. This PR introduces a shim that converts mixed type elements to strings before converting the input into an array, and it has a shim that decodes and encodes unicode, essentially forcing it into utf endpoint ASCII gibberish.
This PRcloses#7988
PR Checklist