From ec5aafc3eaef858a23c5f9ced094159f31e170f4 Mon Sep 17 00:00:00 2001 From: Ameyanagi <77273474+Ameyanagi@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:04:13 -0400 Subject: [PATCH] bugfix npad argument for smooth function --- larch/math/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/larch/math/utils.py b/larch/math/utils.py index a0401e177..4706f6d07 100644 --- a/larch/math/utils.py +++ b/larch/math/utils.py @@ -296,7 +296,8 @@ def smooth(x, y, sigma=1, gamma=None, xstep=None, npad=None, form='lorentzian'): xstep = min(np.diff(x)) if xstep < TINY: raise Warning('Cannot smooth data: must be strictly increasing ') - npad = 5 + if npad is None: + npad = 5 xmin = xstep * int( (min(x) - npad*xstep)/xstep) xmax = xstep * int( (max(x) + npad*xstep)/xstep) npts1 = 1 + int(abs(xmax-xmin+xstep*0.1)/xstep)