Repository navigation
Fix nightly test errors - #14891
Merged
Merged
Fix nightly test errors#14891
Conversation
NumPy 1.18.x will not like setting an array slice with a ragged array like this.
tacaswell
reviewed
Jul 26, 2019
| xlim = self.get_xlim() | ||
| ylim = self.get_ylim() | ||
| edge_size = max(np.diff(xlim), np.diff(ylim)) | ||
| edge_size = max(np.diff(xlim), np.diff(ylim))[0] |
Member
There was a problem hiding this comment.
Suggested change
| edge_size = max(np.diff(xlim), np.diff(ylim))[0] | |
| edge_size, = max(np.diff(xlim), np.diff(ylim)) |
Will that work instead?
Member
There was a problem hiding this comment.
And is this a behavior change that is intentional on numpy's part or something we should be reporting back up to them?
Member
Author
There was a problem hiding this comment.
It would work, but this is merged now...
I've asked upstream on the PR that introduced the change.
Member
There was a problem hiding this comment.
oops, sorry I missed that there was a suggested change in here, and a question.
tacaswell
approved these changes
Jul 26, 2019
tacaswell
left a comment
Member
There was a problem hiding this comment.
Have one minor suggestion, ok either way.
ruidazeng
approved these changes
Jul 26, 2019
Member
|
Merging as numpy report has gone in... |
jschueller
added a commit
to jschueller/matplotlib-feedstock
that referenced
this pull request
Nov 4, 2019
Backports matplotlib/matplotlib#14891 Avoids tracebacks such as: File "$PREFIX/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 1694, in axis self.set_xlim([xlim[0], xlim[0] + edge_size], File "$PREFIX/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 3270, in set_xlim left, right = sorted([left, right], reverse=reverse) TypeError: only integer scalar arrays can be converted to a scalar index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
This fixes 2 of the 3 test errors on the nightly build. There's still one more error slicing a masked array, but I can't figure out how to reproduce that locally and it seems like a bug in NumPy.
PR Checklist