-
Notifications
You must be signed in to change notification settings - Fork 279
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
BUG: Fix typo in vector operations and enable plot modifications for spherical geometry #4378
Conversation
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.
Thanks ! could you provide a simple demo script so we can verify that Streamlines and LIC callbacks just work ?
@@ -529,7 +529,7 @@ def _cartesian_x(field, data): | |||
* np.cos(data[(ftype, "phi")]) | |||
+ data[(ftype, f"{basename}_theta")] | |||
* np.cos(data[(ftype, "theta")]) | |||
* np.cos([(ftype, "phi")]) | |||
* np.cos(data[(ftype, "phi")]) |
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.
oof, thank you for catching these !
Sure! Let me add a test for this recently. |
+1/2 on this. Available fields could certainly be better documented, but I think |
I agree that we won't throw an error, while it's unphysical, say, to plot |
IMHO it shouldn't. While velocity vectors and magnetic fields are by far the most common use cases for these callbacks, I don't think that we should invalidate creative usage in any way (no errors, no warnings). |
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Streamline
andLineIntegralConvolution
callbacks for spherical geometrySome further thoughts -- when using
Quiver
,Streamline
andLineIntegralConvolution
callbacks for curvilinear geometries, we assume users know what vector fields to plot (_cartesian_x
,_conic_x
,_cylindrical_radius
etc.), while this is obscure and hidden in the source code. Maybe improvement could be made in future to generate a warning message when users try to useinappropriate
vector fields in those callbacks.