Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
FIX:_safe_first_finite on all non-finite array#25547
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.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -2208,19 +2208,11 @@ def _convert_dx(dx, x0, xconv, convert): | ||||||||||||||||||
| x0 = cbook._safe_first_finite(x0) | ||||||||||||||||||
| except (TypeError, IndexError, KeyError): | ||||||||||||||||||
| pass | ||||||||||||||||||
| try: | ||||||||||||||||||
| x = cbook._safe_first_finite(xconv) | ||||||||||||||||||
| except (TypeError, IndexError, KeyError): | ||||||||||||||||||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think there a few other places where StopIteration is try/excepted for _safe_first_element? Did you check all those? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I hadn't, but I have now. I only found these two: matplotlib/lib/matplotlib/dates.py Lines 1828 to 1831 in7103779
matplotlib/lib/matplotlib/units.py Lines 182 to 185 in7103779
These both predate the change that led to Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't really know - just noted that it happens a few other places, and the more logic we can move into a consistent helper function, the better in my opinion. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
I certainly agree with that. I wonder if further consolidation should wait for a separate PR though, given recent clarifications about what should and should not be backported
| ||||||||||||||||||
| x = xconv | ||||||||||||||||||
| delist = False | ||||||||||||||||||
| if not np.iterable(dx): | ||||||||||||||||||