From 22c326f7ce81bf4c814d984eb9d597a030af27ac Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Sat, 7 Dec 2024 17:15:15 -0500 Subject: [PATCH 1/3] add deprecation warning to resample function --- news/resampler-dep-warn.rst | 23 +++++++++++++++++++++++ src/diffpy/utils/resampler.py | 9 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 news/resampler-dep-warn.rst diff --git a/news/resampler-dep-warn.rst b/news/resampler-dep-warn.rst new file mode 100644 index 00000000..186e3c19 --- /dev/null +++ b/news/resampler-dep-warn.rst @@ -0,0 +1,23 @@ +**Added:** + +* Deprecation warning for resample function in resampler + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/utils/resampler.py b/src/diffpy/utils/resampler.py index e88c4f0b..a924aa45 100644 --- a/src/diffpy/utils/resampler.py +++ b/src/diffpy/utils/resampler.py @@ -15,6 +15,8 @@ """Various utilities related to data parsing and manipulation.""" +import warnings + import numpy @@ -97,6 +99,13 @@ def resample(r, s, dr): Returns resampled (r, s). """ + warnings.warn( + "The 'resample' function is deprecated and will be removed in a future release (3.8.0). \n" + "'resample' has been renamed 'wsinterp' to better reflect functionality. Please use 'wsinterp' instead.", + DeprecationWarning, + stacklevel=2, + ) + dr0 = r[1] - r[0] # Constant timestep if dr0 < dr: From b57dff28d6b62ddead19d76e3eb1ceb13743ba8c Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Sun, 8 Dec 2024 14:23:44 -0500 Subject: [PATCH 2/3] fixed news item --- news/resampler-dep-warn.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/news/resampler-dep-warn.rst b/news/resampler-dep-warn.rst index 186e3c19..9fc31d73 100644 --- a/news/resampler-dep-warn.rst +++ b/news/resampler-dep-warn.rst @@ -1,6 +1,6 @@ **Added:** -* Deprecation warning for resample function in resampler +* **Changed:** @@ -8,7 +8,7 @@ **Deprecated:** -* +* Deprecation warning for resample function in resampler **Removed:** From 461a93c4edc852435f1b990f1c15404acdb22514 Mon Sep 17 00:00:00 2001 From: Alison Wu Date: Sat, 14 Dec 2024 16:45:36 -0500 Subject: [PATCH 3/3] better news item description --- news/resampler-dep-warn.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/resampler-dep-warn.rst b/news/resampler-dep-warn.rst index 9fc31d73..87d8b643 100644 --- a/news/resampler-dep-warn.rst +++ b/news/resampler-dep-warn.rst @@ -8,7 +8,7 @@ **Deprecated:** -* Deprecation warning for resample function in resampler +* resample function in resampler. Replaced with wsinterp with better functionality. **Removed:**