Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/resampler-dep-warn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Deprecation warning for resample function in resampler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not adding functionality so move this from here to Deprecated


**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
9 changes: 9 additions & 0 deletions src/diffpy/utils/resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

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

import warnings

import numpy


Expand Down Expand Up @@ -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:
Expand Down
Loading