diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-03-08 11:34:18 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-03-08 11:34:18 +0100 |
commit | f7e1380547471db864a385ea376ca7154ac65c51 (patch) | |
tree | 8907a1d56074194435a1147e431eeb55894ce62c | |
parent | b95c5f43e89d49bb13d04434a26610aac98a3673 (diff) |
interp: replace deprecated numpy.int with just int
-rw-r--r-- | interp.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |