-
Notifications
You must be signed in to change notification settings - Fork 635
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: streamlines only returns the dx_array, dy_array of last frame #4549
Comments
@tylerjereddy could you please spare a quick glance 👀 here? |
I saw the ping, I'll try to check soon-ish. I'm under some pressure to get SciPy released to support NumPy 2 series, but will try to make some time. |
I agree with Lily that there's a bug here. The lack of input validation is also pretty jarring, I can give an obscure floating point value to the test start frame value and it still passes (pretty silly): --- a/testsuite/MDAnalysisTests/visualization/test_streamlines.py
+++ b/testsuite/MDAnalysisTests/visualization/test_streamlines.py
@@ -88,7 +88,7 @@ def test_streamplot_2D_zero_return(membrane_xtc, univ, tmpdir):
trajectory_file_path=membrane_xtc,
grid_spacing=20,
MDA_selection='name POX',
- start_frame=1,
+ start_frame=np.sqrt(17),
end_frame=2,
xmin=univ.atoms.positions[...,0].min(),
xmax=univ.atoms.positions[...,0].max(), So yeah, definitely some issues here. Not sure that Lily should be burdened with fixing them all at this time, but definitely good to have issue(s) open so folks can be aware. |
@tylerjereddy is this bug something you could fix? |
Probably, it sounds like Lily may fix it during the refactor to AnalysisBase in any case though. |
Expected behavior
From a skim over the docs and code my impression was that
streamlines.generate_streamlines
would incorporate all frames betweenstart_frame
andend_frame
in the dx_array, but looking more closely at the code I'm not sure that happens. Is it supposed to?Actual behavior
I can get this test to pass with start_frame=0, start_frame=1, and start_frame=2.
mdanalysis/testsuite/MDAnalysisTests/visualization/test_streamlines.py
Lines 54 to 80 in 6ec838b
Because
xy_deltas_to_write
is returned from this function, it looks like the results get re-set for each frame:mdanalysis/package/MDAnalysis/visualization/streamlines.py
Lines 201 to 214 in 6ec838b
Current version of MDAnalysis
python -c "import MDAnalysis as mda; print(mda.__version__)"
)python -V
)?The text was updated successfully, but these errors were encountered: