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

updated atoms.coordinates() with atoms.positions #3467 #3576

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/MDAnalysis/analysis/encore/covariance.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def covariance_matrix(ensemble,
# Select the same atoms in reference structure
reference_atom_selection = reference.select_atoms(
ensemble.get_atom_selection_string())
reference_coordinates = reference_atom_selection.atoms.coordinates()
reference_coordinates = reference_atom_selection.atoms.positions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test that check this fix works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you tell me please, how to add test?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manishsaini6421 please write a function with code that uses this pathway. It should fail with the original .coordinates() and succeed with the new .positions. Have a look at the tests in https://github.com/MDAnalysis/mdanalysis/blob/develop/testsuite/MDAnalysisTests/analysis/test_encore.py and more generally throughout https://github.com/MDAnalysis/mdanalysis/tree/develop/testsuite/MDAnalysisTests for ideas :)


# Flatten reference coordinates
reference_coordinates = reference_coordinates.flatten()
Expand Down