diff --git a/package/CHANGELOG b/package/CHANGELOG index cf92b0533d3..423985e499f 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -53,6 +53,8 @@ Deprecations * core.universe.as_Universe() will be removed in 2.0.0 * analysis.leaflets.LeafletFinder() will not accept a filename any more, only a Universe, in 2.0.0 + * analysis.helanal will be removed in 2.0.0 and replaced by + analysis.helix_analysis (PR #2622) 06/09/20 richardjgowers, kain88-de, lilyminium, p-j-smith, bdice, joaomcteixeira, diff --git a/package/MDAnalysis/analysis/helanal.py b/package/MDAnalysis/analysis/helanal.py index 3ee8bd053c3..17d119c4c37 100644 --- a/package/MDAnalysis/analysis/helanal.py +++ b/package/MDAnalysis/analysis/helanal.py @@ -30,13 +30,20 @@ """ -HELANAL --- analysis of protein helices -======================================= +HELANAL (Deprecated) --- analysis of protein helices +==================================================== :Author: Benjamin Hall , Oliver Beckstein, Xavier Deupi :Year: 2009, 2011, 2013 :License: GNU General Public License v2 (or higher) +.. note:: + + This module was deprecated in 1.0 and will be removed in 2.0. + Please use MDAnalysis.analysis.helix_analysis instead + (available in 2.0.0). + + The :mod:`MDAnalysis.analysis.helanal` module is a Python implementation of the HELANAL_ algorithm [Bansal2000]_ in `helanal.f`_, which is also available through the `HELANAL webserver`_. @@ -117,20 +124,24 @@ """ from __future__ import print_function, division, absolute_import -from six.moves import range, zip - import os import numpy as np import MDAnalysis -from MDAnalysis.lib.log import ProgressBar -from MDAnalysis.lib import mdamath +from ..lib.log import ProgressBar +from ..lib import mdamath, util import warnings import logging logger = logging.getLogger("MDAnalysis.analysis.helanal") +warnings.warn("This module is deprecated as of MDAnalysis version 1.0. " + "It will be removed in MDAnalysis version 2.0." + "Please use (available in 2.0.0) " + "MDAnalysis.analysis.helix_analysis instead.", + category=DeprecationWarning) + def center(coordinates): """Return the geometric center (centroid) of the coordinates. @@ -158,6 +169,9 @@ def mean_abs_dev(a, mean_a=None): mean_a = np.mean(a) return np.mean(np.fabs(a - mean_a)) + +@util.deprecate(release="1.0.1", remove="2.0", + message="In 2.0 use the upcoming helix_analysis module") def helanal_trajectory(universe, select="name CA", begin=None, finish=None, matrix_filename="bending_matrix.dat", @@ -243,7 +257,12 @@ def helanal_trajectory(universe, select="name CA", .. versionchanged:: 1.0.0 Changed `selection` keyword to `select` + + .. deprecated:: 1.0.1 + helanal_trajectory is deprecated and will be removed in 2.0.0. + Please use helix_analysis.HELANAL instead (available in 2.0.0). """ + if ref_axis is None: ref_axis = np.array([0., 0., 1.]) else: @@ -525,6 +544,8 @@ def stats(some_list): return [list_mean, list_sd, list_abdev] +@util.deprecate(release="1.0.1", remove="2.0", + message="In 2.0 use the upcoming helix_analysis module") def helanal_main(pdbfile, select="name CA", ref_axis=None): """Simple HELANAL_ run on a single frame PDB/GRO. @@ -581,6 +602,10 @@ def helanal_main(pdbfile, select="name CA", ref_axis=None): .. versionchanged:: 1.0.0 Changed `selection` keyword to `select` + .. deprecated:: 1.0.1 + helanal_trajectory is deprecated and will be removed in 2.0.0. + Please use helix_analysis.HELANAL instead (available in 2.0.0). + """ universe = MDAnalysis.Universe(pdbfile) diff --git a/testsuite/MDAnalysisTests/analysis/test_helanal.py b/testsuite/MDAnalysisTests/analysis/test_helanal.py index 4d176af7a0c..2b7e5986aaa 100644 --- a/testsuite/MDAnalysisTests/analysis/test_helanal.py +++ b/testsuite/MDAnalysisTests/analysis/test_helanal.py @@ -198,14 +198,13 @@ def test_warnings(tmpdir): u, select="name CA", begin=-1, finish=99999 ) - assert len(record) == 2 + assert len(record) == 3 wmsg1 = ("The input begin time (-1 ps) precedes the starting " "trajectory time --- Setting starting frame to 0".format( -1,0)) - assert str(record[0].message.args[0]) == wmsg1 + assert str(record[1].message.args[0]) == wmsg1 wmsg2 = ("The input finish time ({0} ps) occurs after the end of " "the trajectory ({1} ps). Finish time will be set to " "the end of the trajectory".format( 99999,1000.0000762939453)) - assert str(record[1].message.args[0]) == wmsg2 - + assert str(record[2].message.args[0]) == wmsg2