diff --git a/news/resampler-dep-warn.rst b/news/resampler-dep-warn.rst new file mode 100644 index 00000000..87d8b643 --- /dev/null +++ b/news/resampler-dep-warn.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* resample function in resampler. Replaced with wsinterp with better functionality. + +**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: