Skip to content

Commit fbf761d

Browse files
Alison WuAlison Wu
authored andcommitted
@deprecated and better message wording
1 parent af7ffd4 commit fbf761d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/diffpy/utils/resampler.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
"""Various utilities related to data parsing and manipulation."""
1717

18-
import warnings
18+
from warnings import deprecated
1919

2020
import numpy
2121

@@ -79,6 +79,11 @@ def wsinterp(x, xp, fp, left=None, right=None):
7979
return fp_at_x
8080

8181

82+
@deprecated(
83+
"The 'resample' function is deprecated and will be removed in a future release 3.6.3. \n"
84+
"'resample' has been renamed 'wsinterp' to better reflect functionality. \n"
85+
"Please use 'wsinterp' instead."
86+
)
8287
def resample(r, s, dr):
8388
"""Resample a PDF on a new grid.
8489
@@ -99,13 +104,6 @@ def resample(r, s, dr):
99104
Returns resampled (r, s).
100105
"""
101106

102-
warnings.warn(
103-
"The 'resample' function is deprecated and will be removed in a future release. \n"
104-
"Please use 'wsinterp' instead.",
105-
DeprecationWarning,
106-
stacklevel=2,
107-
)
108-
109107
dr0 = r[1] - r[0] # Constant timestep
110108

111109
if dr0 < dr:

0 commit comments

Comments
 (0)