Skip to content

Commit

Permalink
fix using 'nu' argument
Browse files Browse the repository at this point in the history
  • Loading branch information
espdev committed Jul 19, 2020
1 parent 84c448a commit 92f01d8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions csaps/_sspndg.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,19 @@ def __call__(self,
interpolation axis in the original array with the shape of x.
"""

x = ndgrid_prepare_data_vectors(x, 'x', min_size=1)

if len(x) != self.ndim:
raise ValueError(
f"'x' sequence must have length {self.ndim} according to 'breaks'")

if nu is None:
nu = (0,) * len(x)

if extrapolate is None:
extrapolate = True

shape = tuple(x.size for x in x)

coeffs = ndg_coeffs_to_flatten(self.coeffs)
Expand All @@ -128,8 +135,9 @@ def __call__(self,
coeffs = coeffs.reshape(c_shape)

coeffs_cnl = umv_coeffs_to_canonical(coeffs, self.pieces[i])
coeffs = PPoly.construct_fast(coeffs_cnl, self.breaks[i],
extrapolate=extrapolate, axis=1)(x[i])

spline = PPoly.construct_fast(coeffs_cnl, self.breaks[i], axis=1)
coeffs = spline(x[i], nu=nu[i], extrapolate=extrapolate)

shape_r = (*coeffs_shape[:ndim_m1], shape[i])
coeffs = coeffs.reshape(shape_r).transpose(permuted_axes)
Expand Down

0 comments on commit 92f01d8

Please sign in to comment.