Skip to content

Raise errors on invalid axis limits #8216

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

alixxxin
Copy link

@alixxxin alixxxin commented Mar 7, 2017

Raise error when xlim is set to nan or inf, same with both set_xlim, set_ylim, set_xlim3d, set_ylim3d, set_zlim3d.
Tests are included too

Fixes #7460

@@ -602,6 +602,10 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False, **kw):
if right is None and cbook.iterable(left):
left, right = left

if ((np.isscalar(left)) and not (np.isfinite(left))) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need the trailing \, enclosing in () does the job.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -2873,6 +2873,11 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
left, right = left

self._process_unit_info(xdata=(left, right))

if ((np.isscalar(left)) and not (np.isfinite(left))) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably go after converting the units.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Mar 7, 2017
@tacaswell
Copy link
Member

github-foo linkage: #7460

@tacaswell
Copy link
Member

#7744 fixed the bug. Can this PR be re-based and sort out if the tests should be expanded?

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to sort out if tests are redundant, code changes are redundant.

@dstansby
Copy link
Member

dstansby commented Mar 8, 2017

I've just changed the title to make it more descriptive; it's much more useful to have a short description in the title than just the bug number.

It also looks like there's some PEP8 errors - you can see them by clicking on the travis link below.

@dstansby dstansby changed the title Fix 7460 Raise errors on invalid axis limits Mar 8, 2017
@QuLogic
Copy link
Member

QuLogic commented Mar 9, 2017

FYI, those last three commits have some odd emails for the author/committer.

@tacaswell
Copy link
Member

Do we still need this PR now that #7744 has been merged? I think the tests are more through from this one?

@QuLogic
Copy link
Member

QuLogic commented Apr 4, 2017

I think #8022 might cover even more tests.

@QuLogic
Copy link
Member

QuLogic commented Apr 13, 2017

This PR is covered by #7744 and #8022; sorry about that @alixxxin. We hope that doesn't deter you from contributing in the future.

@QuLogic QuLogic closed this Apr 13, 2017
@QuLogic QuLogic removed this from the 2.1 (next point release) milestone Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants