Skip to content

Commit 7a39a6a

Browse files
authored
Support numpy>=1.24 (#318)
* Fix value error with numpy>=1.24 * Fix value error with numpy>=1.24
1 parent 65e2fe8 commit 7a39a6a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pysteps/noise/fftgenerators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ def initialize_nonparam_2d_ssft_filter(field, **kwargs):
507507
# SSFT algorithm
508508

509509
# prepare indices
510-
idxi = np.zeros((2, 1), dtype=int)
511-
idxj = np.zeros((2, 1), dtype=int)
510+
idxi = np.zeros(2, dtype=int)
511+
idxj = np.zeros(2, dtype=int)
512512

513513
# number of windows
514514
num_windows_y = np.ceil(float(dim_y) / win_size[0]).astype(int)
@@ -793,8 +793,8 @@ def generate_noise_2d_ssft_filter(F, randstate=None, seed=None, **kwargs):
793793
cN = np.zeros(dim)
794794
sM = np.zeros(dim)
795795

796-
idxi = np.zeros((2, 1), dtype=int)
797-
idxj = np.zeros((2, 1), dtype=int)
796+
idxi = np.zeros(2, dtype=int)
797+
idxj = np.zeros(2, dtype=int)
798798

799799
# get the window size
800800
win_size = (float(dim_y) / F.shape[0], float(dim_x) / F.shape[1])

pysteps/nowcasts/sseps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ def estimator(precip, parsglob=None, idxm=None, idxn=None):
466466
M, N = precip.shape[1:]
467467
n_windows_M = np.ceil(1.0 * M / win_size[0]).astype(int)
468468
n_windows_N = np.ceil(1.0 * N / win_size[1]).astype(int)
469-
idxm = np.zeros((2, 1), dtype=int)
470-
idxn = np.zeros((2, 1), dtype=int)
469+
idxm = np.zeros(2, dtype=int)
470+
idxn = np.zeros(2, dtype=int)
471471

472472
if measure_time:
473473
starttime = time.time()
@@ -677,8 +677,8 @@ def worker(j):
677677

678678
# then the local steps
679679
if n_windows_M > 1 or n_windows_N > 1:
680-
idxm = np.zeros((2, 1), dtype=int)
681-
idxn = np.zeros((2, 1), dtype=int)
680+
idxm = np.zeros(2, dtype=int)
681+
idxn = np.zeros(2, dtype=int)
682682
precip_l = np.zeros((M, N), dtype=float)
683683
M_s = np.zeros((M, N), dtype=float)
684684
for m in range(n_windows_M):

0 commit comments

Comments
 (0)