Skip to content

add deprecation warning to resample function #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
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:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* 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.

how about "resample function in resampler. Repaced with wsinterp" or sthg like that?

This news is user-facing so it should be targeted at someone who might be using the code.


**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