Skip to content
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

rsmd atom_indices checks fix #1571

Merged
merged 2 commits into from
Aug 4, 2020
Merged

rsmd atom_indices checks fix #1571

merged 2 commits into from
Aug 4, 2020

Conversation

PolyachenkoYA
Copy link
Contributor

@PolyachenkoYA PolyachenkoYA commented Aug 2, 2020

As I understand, atom_indices are indices of atoms in the target, and ref_atom_indices are indices in the reference.

However here atom_indices are compared to the reference size, but they shouldn't be since they index atoms in a different trajectory (topology).

The same applies here where ref_atom_indices are compared to the target size.

@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 2, 2020

Could you also add a test that fails with the current version put passes given this change?

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 2, 2020 via email

@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 2, 2020

Maybe just a little synthetic example that could be added to the test suite?

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 3, 2020 via email

@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 3, 2020

I was thinking something tiny and/or using only the files that are already included in the repo. It shouldn't be necessary to add another 2 PDB files to this repository and force everyone to download them when they clone the repo.

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 3, 2020 via email

@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 3, 2020

What I really have in mind is something like this:

def test_gh_1571():
  n_atoms_1 = 100
  n_atoms_2 = 10
  n_frames = 1
  trj_1 = md.Trajectory(xyz=np.random.RandomState(0).randn(n_frames, n_atoms_1, 3)
  trj_2 = md.Trajectory(xyz=np.random.RandomState(0).randn(n_frames, n_atoms_2, 3)
  md.rmsd(trj_1, trj_2, ...)  # something that shows the bug

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 3, 2020 via email

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 3, 2020 via email

@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 3, 2020

Could you add that into the pull request?

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 3, 2020 via email

@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 3, 2020

Your pull request currently modifies the file mdtraj/rmsd/_rmsd.pyx, but could you also add that test to the file tests/test_rmsd.py? That way it will be run by the the continuous integration system.

@PolyachenkoYA
Copy link
Contributor Author

PolyachenkoYA commented Aug 4, 2020 via email

@rmcgibbo rmcgibbo merged commit 2925c0e into mdtraj:master Aug 4, 2020
@rmcgibbo
Copy link
Member

rmcgibbo commented Aug 4, 2020

Thanks, @PolyachenkoYA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants