def _reset_nest(self, data, nest=None): n = data[10] if nest is None: k,m = data[5],len(data[0]) nest = m+k+1 # this is the maximum bound for nest else: if not n <= nest: raise ValueError("`nest` can only be increased") t, c, fpint, nrdata = [np.resize(data[n], nest) for n in [8,9,11,12]] args = data[:8] + (t,c,n,fpint,nrdata,data[13]) data = dfitpack.fpcurf1(*args) return data
def _reset_nest(self, data, nest=None): n = data[10] if nest is None: k, m = data[5], len(data[0]) nest = m + k + 1 # this is the maximum bound for nest else: assert n <= nest, "nest can only be increased" t, c, fpint, nrdata = data[8].copy(), data[9].copy(), data[11].copy(), data[12].copy() t.resize(nest) c.resize(nest) fpint.resize(nest) nrdata.resize(nest) args = data[:8] + (t, c, n, fpint, nrdata, data[13]) data = dfitpack.fpcurf1(*args) return data
def _reset_nest(self, data, nest=None): n = data[10] if nest is None: k,m = data[5],len(data[0]) nest = m+k+1 # this is the maximum bound for nest else: assert n<=nest,"nest can only be increased" t,c,fpint,nrdata = data[8].copy(),data[9].copy(),\ data[11].copy(),data[12].copy() t.resize(nest) c.resize(nest) fpint.resize(nest) nrdata.resize(nest) args = data[:8] + (t,c,n,fpint,nrdata,data[13]) data = dfitpack.fpcurf1(*args) return data
def set_smoothing_factor(self, s): """ Continue spline computation with the given smoothing factor s and with the knots found at the last call. """ data = self._data if data[6] == -1: warnings.warn("smoothing factor unchanged for" "LSQ spline with fixed knots") return args = data[:6] + (s,) + data[7:] data = dfitpack.fpcurf1(*args) if data[-1] == 1: # nest too small, setting to maximum bound data = self._reset_nest(data) self._data = data self._reset_class()
def set_smoothing_factor(self, s): """ Continue spline computation with the given smoothing factor s and with the knots found at the last call. """ data = self._data if data[6] == -1: warnings.warn('smoothing factor unchanged for' 'LSQ spline with fixed knots') return args = data[:6] + (s, ) + data[7:] data = dfitpack.fpcurf1(*args) if data[-1] == 1: # nest too small, setting to maximum bound data = self._reset_nest(data) self._data = data self._reset_class()