From f7e1380547471db864a385ea376ca7154ac65c51 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 8 Mar 2023 11:34:18 +0100 Subject: interp: replace deprecated numpy.int with just int --- interp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interp.py b/interp.py index 757d927..e326e6d 100644 --- a/interp.py +++ b/interp.py @@ -3,7 +3,7 @@ import ctypes import numpy as np def interp1d(src_start, src_step, src_val, dst_coords, stencil): - idx_src = ((dst_coords - src_start) / src_step - (stencil / 2 - 1)).astype(np.int) + idx_src = ((dst_coords - src_start) / src_step - (stencil / 2 - 1)).astype(int) src_coord = np.linspace(src_start, src_start + src_step * (src_val.shape[0] - 1), src_val.shape[0], dtype = src_val.dtype) @@ -22,7 +22,7 @@ def interp1d(src_start, src_step, src_val, dst_coords, stencil): return ret def interp1d_irregular(src_coord, src_val, dst_coord, stencil): - idx_src = np.empty(dst_coord.shape, dtype = np.int) + idx_src = np.empty(dst_coord.shape, dtype = int) for i, dc in enumerate(dst_coord): idx_src[i] = np.where(src_coord - dc < 0, src_coord, -np.inf).argmax() - stencil / 2 + 1 @@ -49,7 +49,7 @@ def interp2d(src_start, src_step, src_val, dst_coords, stencil): src_coord = np.linspace(src_start[dim], src_start[dim] + src_step[dim] * (src_val.shape[dim] - 1), src_val.shape[dim], dtype = src_val.dtype) - idx = ((dst_coords[dim] - src_start[dim]) / src_step[dim] - (stencil / 2 - 1)).astype(np.int) + idx = ((dst_coords[dim] - src_start[dim]) / src_step[dim] - (stencil / 2 - 1)).astype(int) f = np.zeros((stencil, ) + idx.shape, dtype = src_val.dtype) + 1.0 -- cgit v1.2.3