TST: Make proj3d tests into real tests#7310
Conversation
|
|
||
|
|
||
| @image_comparison(baseline_images=['proj3d_axes_cube'], extensions=['png']) | ||
| def test_proj_axes_cube(): |
There was a problem hiding this comment.
These might be good candidates for removing the text (so we do not test the tick labels)?
There was a problem hiding this comment.
Yes, good point; tick labels are unimportant for these tests. I also switched it to the default style because I don't see why new test images need to use the classic style.
|
|
||
| pylab.show() | ||
|
|
||
| def rot_x(V, alpha): |
There was a problem hiding this comment.
This function is not used internally, exists since 2009 with an error and no one noticed that. Maybe it is better to remove it?
| o = (txs[0], tys[0]) | ||
| ax = (txs[1], tys[1]) | ||
| ay = (txs[2], tys[2]) | ||
| az = (txs[3], tys[3]) |
| ys = (20, 150) | ||
| ax.plot(xs, ys) | ||
| points = list(zip(xs, ys)) | ||
| p0, p1 = points |
There was a problem hiding this comment.
p0, p1 = points = list(zip(xs, ys)) or even p0, p1 = zip(xs, ys) as points is unused
|
I think this is a great idea, and I can't believe I didn't think of this myself. My understanding of the development of mplot3d suggests that these weren't really test functions in the truest sense, but rather debugging tools to help with the original development of the toolkit. But, they do provide useful graphics that I wished I had noticed before, and may be helpful if I ever take up trying to port mplot3d over to the Transforms system. And thanks for noticing the bug in |
Bundling them up in the middle of the code ensures they're never run.
I'm pretty sure a rotation should not re-scale w.
413e34f to
de67c8c
Compare
|
Yea, |
|
|
|
Yes, quite likely. I'll leave it up to @WeatherGod. |
|
I want to leave it in so that it can be used as a debugging tool in future refactors. |
For some reason, these are buried in
mplot3d/proj3d.pyinstead of in a test file. I guess they're sort of implicitly tested with the rest of the 3D plots, but it's also useful to test them by themselves.I think the tests are all okay except
test_world, because I'm not totally sure whatworld_transformationis trying to do, but I guess it's okay since it's used for drawing.