diff --git a/benchmarks/benchmarks/analysis/rms.py b/benchmarks/benchmarks/analysis/rms.py index 3d34f386c5a..bd1040cee04 100644 --- a/benchmarks/benchmarks/analysis/rms.py +++ b/benchmarks/benchmarks/analysis/rms.py @@ -34,9 +34,9 @@ def setup(self, num_atoms, weights, center, superposition): self.u.trajectory[-1] self.B = self.u.atoms.positions.copy()[:num_atoms] except: - self.A = self.u.atoms.coordinates().copy()[:num_atoms] + self.A = self.u.atoms.positions.copy()[:num_atoms] self.u.trajectory[-1] - self.B = self.u.atoms.coordinates().copy()[:num_atoms] + self.B = self.u.atoms.positions.copy()[:num_atoms] def time_rmsd(self, num_atoms, weights, center, superposition): """Benchmark rmsd function using a setup similar to diff --git a/package/MDAnalysis/analysis/encore/covariance.py b/package/MDAnalysis/analysis/encore/covariance.py index 352d934f9d5..0887749c010 100644 --- a/package/MDAnalysis/analysis/encore/covariance.py +++ b/package/MDAnalysis/analysis/encore/covariance.py @@ -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 # Flatten reference coordinates reference_coordinates = reference_coordinates.flatten() diff --git a/testsuite/MDAnalysisTests/analysis/test_encore.py b/testsuite/MDAnalysisTests/analysis/test_encore.py index b579c02bdbb..0e36272892f 100644 --- a/testsuite/MDAnalysisTests/analysis/test_encore.py +++ b/testsuite/MDAnalysisTests/analysis/test_encore.py @@ -395,6 +395,12 @@ def test_dres_error_estimation(self, ens1): assert stdev < stdev_upper_bound, "Unexpected standard deviation for" \ " bootstrapped samples in Dim. reduction Ensemble imilarity" + def test_covariance_matrix(self, ens1, ens2): + covariance_of_matrix = encore.covariance_matrix(ensemble=ens1, + reference=ens2) + + assert covariance_of_matrix is np.zeros(len(ens1), 3) + class TestEncoreClustering(object): @pytest.fixture(scope='class') def ens1_template(self):