Skip to content

Commit 43dcd71

Browse files
committed
update tests and small param order adjustment
1 parent 9f9e49f commit 43dcd71

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: src/diffpy/pdfgui/control/fitdataset.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,11 @@ def _updateRcalcSampling(self):
614614
tp = self.getFitSamplingType()
615615
# Gcalc:
616616
if len(self._Gcalc) > 0:
617-
newGcalc = grid_interpolation(self._rcalc, self._Gcalc, newrcalc, tp)
617+
newGcalc = grid_interpolation(self._rcalc, self._Gcalc, newrcalc, tp = tp)
618618
self._Gcalc = list(newGcalc)
619619
# dGcalc
620620
if len(self._dGcalc) > 0:
621-
newdGcalc = grid_interpolation(self._rcalc, self._dGcalc, newrcalc, tp)
621+
newdGcalc = grid_interpolation(self._rcalc, self._dGcalc, newrcalc, tp = tp)
622622
self._dGcalc = list(newdGcalc)
623623
# invalidate Gtrunc and dGtrunc
624624
self._Gtrunc = []
@@ -712,7 +712,7 @@ def _get_Gtrunc(self):
712712
self._updateRcalcSampling()
713713
if not self._Gtrunc:
714714
tp = self.getFitSamplingType()
715-
newGtrunc = grid_interpolation(self.robs, self.Gobs, self.rcalc, tp)
715+
newGtrunc = grid_interpolation(self.robs, self.Gobs, self.rcalc, tp = tp)
716716
self._Gtrunc = list(newGtrunc)
717717
return self._Gtrunc
718718

@@ -733,9 +733,9 @@ def _get_dGtrunc(self):
733733
self.robs,
734734
self.dGobs,
735735
self.rcalc,
736-
tp,
737736
left=sum(self.dGobs[:1]),
738737
right=sum(self.dGobs[-1:]),
738+
tp = tp,
739739
)
740740
self._dGtrunc = list(newdGtrunc)
741741
return self._dGtrunc
@@ -814,7 +814,7 @@ def _linear_interpolation(x0, y0, x1, youtleft, youtright):
814814
return y1
815815

816816

817-
def grid_interpolation(x0, y0, x1, tp, left=None, right=None):
817+
def grid_interpolation(x0, y0, x1, left=None, right=None, tp=None):
818818
"""Interpolate values from one grid onto another using either linear or
819819
Whittaker–Shannon interpolation.
820820

Diff for: tests/test_fitdataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_grid_interpolation(self):
3939
y0 = numpy.sin(x0)
4040
x1 = [-6, x0[0], -0.2, x0[-1], 37]
4141
y1a = fds.grid_interpolation(x0, y0, x1)
42-
y1b = fds.grid_interpolation(x0, y0, x1, youtleft=637, youtright=638)
42+
y1b = fds.grid_interpolation(x0, y0, x1, left=637, right=638)
4343
# outside values
4444
self.assertEqual(0.0, y1a[0])
4545
self.assertEqual(637, y1b[0])

0 commit comments

Comments
 (0)