Conversation
|
This is going to break so many PRs /o\ |
lib/mpl_toolkits/mplot3d/art3d.py
Outdated
|
|
||
| def get_colors(c, num): | ||
| """Stretch the color argument to provide the required number num""" | ||
| return np.broadcast_to( |
There was a problem hiding this comment.
Travis is failing because this method isn't available in older numpys.
tools/gh_api.py
Outdated
| token, = f | ||
| return token | ||
| except: | ||
| except OSError: |
There was a problem hiding this comment.
Oh, I missed the fact that the two are not synonyms in Py2 :-) Can open raise both OSError and IOError?
There was a problem hiding this comment.
Not sure about open(), but the read token, = f could produce an IOError.
There was a problem hiding this comment.
also, thinking about it, what if the file was malformed? (e.g., many lines), in which case a simple readline() might actually be more correct as that would result in an IOError rather than what ever the error is when doing something like a, b = 1, 2, 3
There was a problem hiding this comment.
I'll just make it Exception.
dopplershift
left a comment
There was a problem hiding this comment.
Wow, this cleans up so many....interesting things. Especially nice to no longer have 3 separate values defined for pi within the code base.
| verbose.report("Could not open font file %s" % fpath) | ||
| continue | ||
| try: | ||
| try: |
There was a problem hiding this comment.
This probably dates back to before you could actually have an except and finally on the same try.
| try: | ||
| return super(BackendGtkAgg, self).check() | ||
| except: | ||
| raise |
There was a problem hiding this comment.
I think try:...except: raise has to be my favorite of these. WTF?
There was a problem hiding this comment.
Actually the whole method override can go away...
lib/matplotlib/font_manager.py
Outdated
| try: | ||
| fh = open(fpath, 'rb') | ||
| except: | ||
| except OSError: |
There was a problem hiding this comment.
Might need IOError here as well.
There was a problem hiding this comment.
EnvironmentError is what we want, actually.
| if mouseevent.inaxes is None or ax is None or \ | ||
| mouseevent.inaxes == ax: | ||
| if (mouseevent.inaxes is None or ax is None | ||
| or mouseevent.inaxes == ax): |
There was a problem hiding this comment.
Operator goes before the line break.
There was a problem hiding this comment.
I tend to (very much) favor the newer PEP8 recommendations (https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator) which I think is usually more readable.
There was a problem hiding this comment.
I thought it complained on a different PR, but it seems to have passed here? Not too important...
lib/matplotlib/artist.py
Outdated
| else: | ||
| raise ValueError('match must be None, an ' | ||
| 'matplotlib.artist.Artist ' | ||
| raise ValueError('match must be None, an matplotlib.artist.Artist ' |
| try: | ||
| adata = np.array(data) | ||
| except: | ||
| except Exception: |
There was a problem hiding this comment.
What does it raise other than TypeError and/or ValueError?
There was a problem hiding this comment.
type(data).__array__(data) can raise whatever it wants.
There was a problem hiding this comment.
Oh, I thought np.array would wrap that sort of stuff; carry on, then.
lib/matplotlib/image.py
Outdated
| if x is not None and y is not None: | ||
| inside = ((x >= xmin) and (x <= xmax) and | ||
| (y >= ymin) and (y <= ymax)) | ||
| inside = xmin <= x <= xmax and ymin <= y <= ymax |
There was a problem hiding this comment.
I know they're all ands, but I'd put parentheses just the same.
There was a problem hiding this comment.
I think this line reads quite clearly? There's only one and now.
There was a problem hiding this comment.
I know it's redundant, but I like parentheses around the x and y parts; it's not a major thing, though.
There was a problem hiding this comment.
I agree with @QuLogic. Extra parentheses can greatly help readability, and in such cases, like this one, they do no harm at all.
lib/matplotlib/rcsetup.py
Outdated
| except KeyError: | ||
| raise ValueError( | ||
| 'Supported Postscript/PDF font types are %s' % | ||
| list(six.iterkeys(fonttypes))) |
There was a problem hiding this comment.
Can you make it list(fonttypes.keys())? Why bother with six for this...
There was a problem hiding this comment.
just list(fonttypes)
| removed. | ||
|
|
||
| The ``ArtistInspector.findobj`` method, which was never working due to the lack | ||
| of a ``get_children`` method, has been removed. |
There was a problem hiding this comment.
what was lacking get_children?
There was a problem hiding this comment.
The ArtistInspector class.
|
Build's failing; looks like old NumPy don't have |
|
|
|
I'm confused: building numpy 1.7.1 from source shows that it does define Edit: Ah, stupid implicit relative imports |
|
The other failure is due to the change from |
|
Need to update the other formats, not just the png. |
|
Done. |
|
'power cycled' to restart all of the CI |
| import numpy as np | ||
|
|
||
|
|
||
| # Copy-pasted from numpy.lib.stride_tricks 1.11.2. |
There was a problem hiding this comment.
Can you add this comment on all functions? This will help in the future if any others are added here and these need to be removed.
Current coverage is 62.02% (diff: 58.33%)@@ master #7544 diff @@
==========================================
Files 173 174 +1
Lines 56177 56296 +119
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 34784 34918 +134
+ Misses 21393 21378 -15
Partials 0 0
|
|
restarted the travis test (looks like weird filesystem related failures). The appveyor tests look transient |
What I did during a five-hour flight (split into multiple PRs to keep things reviewable)...
Apparently github doesn't show file renames in the diff, in fact
examples/user_interfaces/interactive2.pywas renamed asexamples/user_interfaces/interactive.pyand the previousinteractive.py(which was marked as non-working since 2010) was removed.callablecame back as a builtin in Py3.2.NotImplementedis a singleton.