-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
TST: Make proj3d tests into real tests #7310
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
Conversation
|
||
|
||
@image_comparison(baseline_images=['proj3d_axes_cube'], extensions=['png']) | ||
def test_proj_axes_cube(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These might be good candidates for removing the text (so we do not test the tick labels)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.xlim(-0.2, 0.2) | ||
pylab.ylim(-0.2, 0.2) | ||
|
||
pylab.show() | ||
|
||
def rot_x(V, alpha): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o, ax, ay, az = zip(txs, tys)
ys = (20, 150) | ||
ax.plot(xs, ys) | ||
points = list(zip(xs, ys)) | ||
p0, p1 = points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.py
instead 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_transformation
is trying to do, but I guess it's okay since it's used for drawing.