From 8b3c51f1eb585bcd175323f250190ed1fc7540f5 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Wed, 5 Feb 2025 16:50:33 -0500 Subject: [PATCH] fix: fix TypeError when using Nyquist interp --- news/interp_xtype.rst | 23 +++++++++++++++++++++++ src/diffpy/pdfgui/control/fitdataset.py | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 news/interp_xtype.rst diff --git a/news/interp_xtype.rst b/news/interp_xtype.rst new file mode 100644 index 00000000..094877bf --- /dev/null +++ b/news/interp_xtype.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed TypeError when using Nyquist interp. + +**Security:** + +* diff --git a/src/diffpy/pdfgui/control/fitdataset.py b/src/diffpy/pdfgui/control/fitdataset.py index 559e9dbd..11c490d7 100644 --- a/src/diffpy/pdfgui/control/fitdataset.py +++ b/src/diffpy/pdfgui/control/fitdataset.py @@ -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