Skip to content

Commit

Permalink
fix: fix TypeError when using Nyquist interp
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieqiong committed Feb 5, 2025
1 parent 494623c commit 8b3c51f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions news/interp_xtype.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Fixed TypeError when using Nyquist interp.

**Security:**

* <news item>
3 changes: 3 additions & 0 deletions src/diffpy/pdfgui/control/fitdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@ def grid_interpolation(x0, y0, x1, left=None, right=None, tp=None):
Otherwise it uses the internal :func:`_linear_interpolation` routine.
"""
if tp == "Nyquist":
x0 = numpy.asarray(x0)
x1 = numpy.asarray(x1)
y0 = numpy.asarray(y0)
return wsinterp(x1, x0, y0, left, right)
else:
left = 0.0 if left is None else left
Expand Down

0 comments on commit 8b3c51f

Please sign in to comment.