Skip to content
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

Fix empty plot with drawstyle="steps" #9997

Merged
merged 2 commits into from Dec 23, 2017

Conversation

timhoffm
Copy link
Member

Fixes #9597 as suggested there in the comments.

@jklymak
Copy link
Member

jklymak commented Dec 15, 2017

@timhoffm Can you add a test so this doesn't break in the future? Could probably just check that the call doesn't error...

@jklymak
Copy link
Member

jklymak commented Dec 21, 2017

@timhoffm Does this make it through to plot, and can a test be added to test_axes.py?

plot(np.array([]), np.array([]), drawstyle="steps")

@timhoffm
Copy link
Member Author

Yes it does. I've intentionally only added unit tests for the pts_to_*step functions. These were the ones failing. We shouldn't add full integration tests for all possible inputs. This really slows the test suite down.

@jklymak
Copy link
Member

jklymak commented Dec 21, 2017

Ok I’m not sure what the testing philosophy is/should be. To me if it broke once it’ll break again and having a test will stop that. If you can make the test a non-image test I don’t think it takes very long.

@timhoffm
Copy link
Member Author

The things that was broken, were the pts_to_*step functions. And they are tested now, so they can't break again.

Unfortunately, every axes instantiation is quite slow #6664. For a single plot, this doesn't take too long, but it really adds up for several thousand tests.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

I'm not going to hold it up on the testing point.

@jklymak
Copy link
Member

jklymak commented Dec 21, 2017

Just to carry on this discussion: to me, its the user-facing features that need to keep working. Someone could decide to do away with pts_to_pre etc, and implement steps= in a different way, but the user-experience in plot shouldn't change (or at least we should know it breaks a test). But I'm pretty new here, so please don't take that as our policy!

@anntzer
Copy link
Contributor

anntzer commented Dec 23, 2017

I think the test is fine.
Thanks!

@anntzer anntzer merged commit f96fac0 into matplotlib:master Dec 23, 2017
@tacaswell tacaswell added this to the v2.2 milestone Dec 24, 2017
@timhoffm timhoffm deleted the fix-empty-plot-steps branch January 3, 2018 16:48
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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.

None yet

5 participants