From 4af49730766e50a069baaae2ef565ade8a2eeda2 Mon Sep 17 00:00:00 2001 From: spyke7 Date: Wed, 26 Nov 2025 18:40:47 +0530 Subject: [PATCH 1/2] Removed the always keyword for DeprecationWarning in hbonds_autocorrely.py --- package/CHANGELOG | 15 +++++++++++++++ .../analysis/hbonds/hbond_autocorrel.py | 6 ++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index f03ff87bcbe..085730f74bc 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -31,6 +31,21 @@ Changes Deprecations +11/26/25 IAlibay, orbeckst, marinegor, tylerjereddy, ljwoods2, marinegor, spyke7 + + * 2.11.0 + +Fixes + * Fixes the DeprecationWarning in hbonds_autocorrel.py so as the warning + can be suppressed in mdacli which are not needed(Issue #5157, PR #5159) + +Changes + * In the hbonds\hbonds_autocorrel.py, removed the always keyword. And keeping + the message same (Issue #5157, PR #5159) + +Deprecations + + 11/24/25 IAlibay, orbeckst, marinegor, tylerjereddy, ljwoods2, marinegor, spyke7 * 2.11.0 diff --git a/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py b/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py index 3f80affc814..9ab8d0f565c 100644 --- a/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py +++ b/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py @@ -44,14 +44,12 @@ """ import warnings -with warnings.catch_warnings(): - warnings.simplefilter("always", DeprecationWarning) - wmsg = ( +wmsg = ( "This module was moved to " "MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel; " "hbonds.hbond_autocorrel will be removed in 3.0.0." ) - warnings.warn(wmsg, category=DeprecationWarning) +warnings.warn(wmsg, category=DeprecationWarning) from MDAnalysis.lib.util import deprecate From 725b055b5a9abe42193104e23b0d66763ea6a6b7 Mon Sep 17 00:00:00 2001 From: spyke7 Date: Wed, 26 Nov 2025 19:04:27 +0530 Subject: [PATCH 2/2] Reformatted with black --- package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py b/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py index 9ab8d0f565c..5d2632a8203 100644 --- a/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py +++ b/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py @@ -45,11 +45,11 @@ import warnings wmsg = ( - "This module was moved to " - "MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel; " - "hbonds.hbond_autocorrel will be removed in 3.0.0." - ) -warnings.warn(wmsg, category=DeprecationWarning) + "This module was moved to " + "MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel; " + "hbonds.hbond_autocorrel will be removed in 3.0.0." +) +warnings.warn(wmsg, category=DeprecationWarning) from MDAnalysis.lib.util import deprecate