From cffa2074a0c47f116feae3bb9dace4233ad001eb Mon Sep 17 00:00:00 2001 From: Max Linke Date: Fri, 27 Jan 2017 19:19:47 +0100 Subject: [PATCH] fix docs and default parameters --- package/MDAnalysis/analysis/align.py | 7 ++++--- package/MDAnalysis/analysis/encore/covariance.py | 4 ++-- package/MDAnalysis/analysis/rms.py | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package/MDAnalysis/analysis/align.py b/package/MDAnalysis/analysis/align.py index 2d68c7c8829..8f890cb91d8 100644 --- a/package/MDAnalysis/analysis/align.py +++ b/package/MDAnalysis/analysis/align.py @@ -362,10 +362,10 @@ def alignto(mobile, reference, select="all", mass_weighted=None, weights=None, When using 2. or 3. with *sel1* and *sel2* then these selections can also each be a list of selection strings (to generate a AtomGroup with defined atom order as described under :ref:`ordered-selections-label`). - mass_weighted : boolean, optional, deprecated + mass_weighted : boolean, optional (deprecated) ``True`` uses the masses :meth:`reference.masses` as weights for the RMSD fit. - weights : str/array_like (optional) + weights : str/array_like, optional weights to be used for fit. Can be either 'mass' or an array_like tol_mass: float, optional Reject match if the atomic masses for matched atoms differ by more than @@ -395,6 +395,7 @@ def alignto(mobile, reference, select="all", mass_weighted=None, weights=None, old_rmsd RMSD before spatial alignment new_rmsd + RMSD after spatial alignment See Also -------- @@ -411,7 +412,7 @@ def alignto(mobile, reference, select="all", mass_weighted=None, weights=None, the old behavior was the equivalent of *strict* = ``True``. .. versionchanged:: 0.16.0 - new general 'weights' kwarg replace mass_weights + new general 'weights' kwarg replace mass_weights, deprecated 'mass_weights' """ if select in ('all', None): # keep the EXACT order in the input AtomGroups; select_atoms('all') diff --git a/package/MDAnalysis/analysis/encore/covariance.py b/package/MDAnalysis/analysis/encore/covariance.py index 4d5d619b0b7..c2e18e340cb 100644 --- a/package/MDAnalysis/analysis/encore/covariance.py +++ b/package/MDAnalysis/analysis/encore/covariance.py @@ -173,7 +173,7 @@ def shrinkage_covariance_estimator( coordinates, def covariance_matrix(ensemble, selection="name CA", estimator=shrinkage_covariance_estimator, - weights=None, + weights='mass', reference=None): """ Calculates (optionally mass weighted) covariance matrix @@ -190,7 +190,7 @@ def covariance_matrix(ensemble, of frames and M the number of atoms). See ml_covariance_estimator and shrinkage_covariance_estimator for reference. weights : str/array_like (optional) - specify optional weights. If ``mass`` then chose masses of ensemble atoms + specify weights. If ``'mass'`` then chose masses of ensemble atoms, if ``None`` chose uniform weights reference : MDAnalysis.Universe object (optional) Use the distances to a specific reference structure rather than the distance to the mean. diff --git a/package/MDAnalysis/analysis/rms.py b/package/MDAnalysis/analysis/rms.py index 15862198607..8569441b88b 100644 --- a/package/MDAnalysis/analysis/rms.py +++ b/package/MDAnalysis/analysis/rms.py @@ -199,8 +199,8 @@ def rmsd(a, b, weights=None, center=False, superposition=False): if center or superposition: # make copies (do not change the user data!) # weights=None is equivalent to all weights 1 - a = a - np.average(a, axis=0, weights=weights) - b = b - np.average(b, axis=0, weights=weights) + a -= np.average(a, axis=0, weights=weights) + b -= np.average(b, axis=0, weights=weights) if weights is not None: if len(weights) != len(a): @@ -328,9 +328,9 @@ def __init__(self, atomgroup, reference=None, select='all', .. Note:: Experimental feature. Only limited error checking implemented. - filename : str (optional) + filename : str, optional write RSMD into file file :meth:`RMSD.save` - mass_weighted : bool deprecated + mass_weighted : bool (deprecated) do a mass-weighted RMSD fit weights : str/array_like (optional) choose weights. If 'str' uses masses as weights