From 0c3d5f6e683b942eecc9a63c16796d379e8c2a6c Mon Sep 17 00:00:00 2001 From: Eugene Prilepin Date: Sat, 8 Feb 2020 01:58:37 +0300 Subject: [PATCH] a slight refactoring --- csaps/_sspndg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csaps/_sspndg.py b/csaps/_sspndg.py index a91fe80..c0948d4 100644 --- a/csaps/_sspndg.py +++ b/csaps/_sspndg.py @@ -75,7 +75,7 @@ def evaluate(self, xi: ty.Sequence[np.ndarray]) -> np.ndarray: sizey = list(yi.shape) nsize = tuple(x.size for x in xi) - for i in range(self.ndim - 1, -1, -1): + for i in reversed(range(self.ndim)): ndim = int(np.prod(sizey[:self.ndim])) coeffs = yi.reshape((ndim * self.pieces[i], self.order[i]), order='F') @@ -214,7 +214,7 @@ def _make_spline(self, smooth: ty.List[ty.Optional[float]]) -> ty.Tuple[NdGridSp _smooth = [] # Perform coordinatewise smoothing spline computing - for i in range(self._ndim - 1, -1, -1): + for i in reversed(range(self._ndim)): shape_i = (np.prod(sizey[:-1]), sizey[-1]) ydata_i = ydata.reshape(shape_i, order='F')