-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Further shorten quiver3d computation... #15373
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
I compared the running time to my PR and I do see about 10% reduction in time when the number of vectors is high when using your PR, so I disagree with the "no effect on performance" part ;) In addition I received an issue when running your code:
This could be reproduced with this MRE: x, y, z = [np.random.rand(10) for _ in range(3)]
X, Y, Z = np.meshgrid(x, y, z)
U, V, W = [np.random.rand(*X.shape) for _ in range(3)]
ax.quiver(X, Y, Z, U, V, W) I believe I solved this with Can you confirm that you can reproduce this issue? |
If you can reproduce this as well, that also means that the automatic checks missed it somehow and perhaps they need to be improved as well |
Is my version faster or yours?
Did you miss https://github.com/matplotlib/matplotlib/pull/15373/files#diff-84224cb1c8cd1f13b7adc5930ee2fc8fR2625? |
I indeed missed the reshape, thanks! Now there is no issue indeed :)
I ran it again and it isn't faster now. I guess this happened because I only looked at the mean and not at the std as well? |
rebased |
Flake8: ./lib/mpl_toolkits/mplot3d/axes3d.py:2544:17: E128 continuation line under-indented for visual indent |
... by using einsum instead of juggling axis order. This has essentially no effect on performance.
fixed |
... by using einsum instead of juggling axis order.
This has essentially no effect on performance.
followup to #15346.
PR Summary
PR Checklist