Skip to content

Commit

Permalink
Updated test_encore.py (MDAnalysis#4032)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-parmar authored Feb 28, 2023
1 parent 4e3ea0e commit de6d0a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Chronological list of authors
- Christian Pfaendner
- Pratham Chauhan
- Meet Brijwani
- Vishal Parmar


External code
Expand Down
5 changes: 3 additions & 2 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------

??/??/?? IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo, chrispfae,
ooprathamm, MeetB7, BFedder
ooprathamm, MeetB7, BFedder, v-parmar
* 2.5.0

Fixes
* Fix tests should use results.rmsf to avoid DeprecationWarning (Issue #3695)
* Fix EDRReader failing when parsing single-frame EDR files (Issue #3999)
* Fix element parsing from PSF files tests read via Parmed (Issue #4015)
* Fix test clobbering in lib/test_util.py (PR #4000)
Expand Down
14 changes: 9 additions & 5 deletions testsuite/MDAnalysisTests/analysis/test_encore.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_rmsd_matrix_with_superimposition(self, ens1):
err_msg = (
"Calculated RMSD values differ from "
"the reference implementation")
for i, rmsd in enumerate(reference.rmsd):
for i, rmsd in enumerate(reference.results.rmsd):
assert_almost_equal(conf_dist_matrix[0, i], rmsd[2], 3, err_msg)

def test_rmsd_matrix_with_superimposition_custom_weights(self, ens1):
Expand Down Expand Up @@ -211,8 +211,10 @@ def test_ensemble_superimposition(self):
rmsfs2 = rms.RMSF(aligned_ensemble2.select_atoms('name *'))
rmsfs2.run()

assert sum(rmsfs1.rmsf) > sum(rmsfs2.rmsf),"Ensemble aligned on all " \
"atoms should have lower full-atom RMSF than ensemble aligned on only CAs."
assert sum(rmsfs1.results.rmsf) > sum(rmsfs2.results.rmsf), (
"Ensemble aligned on all "
"atoms should have lower full-atom RMSF than ensemble aligned on only CAs."
)

def test_ensemble_superimposition_to_reference_non_weighted(self):
aligned_ensemble1 = mda.Universe(PSF, DCD)
Expand All @@ -230,8 +232,10 @@ def test_ensemble_superimposition_to_reference_non_weighted(self):
rmsfs2 = rms.RMSF(aligned_ensemble2.select_atoms('name *'))
rmsfs2.run()

assert sum(rmsfs1.rmsf) > sum(rmsfs2.rmsf), "Ensemble aligned on all " \
"atoms should have lower full-atom RMSF than ensemble aligned on only CAs."
assert sum(rmsfs1.results.rmsf) > sum(rmsfs2.results.rmsf), (
"Ensemble aligned on all "
"atoms should have lower full-atom RMSF than ensemble aligned on only CAs."
)

def test_covariance_matrix(self, ens1):
reference_cov = np.array([
Expand Down

0 comments on commit de6d0a8

Please sign in to comment.