diff --git a/tests/test_spatialstats.py b/tests/test_spatialstats.py index 83aac8c6..a4ee8ab9 100644 --- a/tests/test_spatialstats.py +++ b/tests/test_spatialstats.py @@ -16,7 +16,7 @@ import xdem from xdem import examples from xdem._typing import NDArrayf -from xdem.spatialstats import EmpiricalVariogramKArgs, nmad, neff_hugonnet_approx +from xdem.spatialstats import EmpiricalVariogramKArgs, neff_hugonnet_approx, nmad with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) diff --git a/xdem/spatialstats.py b/xdem/spatialstats.py index b4614eea..34b2b45d 100644 --- a/xdem/spatialstats.py +++ b/xdem/spatialstats.py @@ -42,7 +42,7 @@ from scipy.interpolate import RegularGridInterpolator, griddata from scipy.optimize import curve_fit from scipy.signal import fftconvolve -from scipy.spatial.distance import pdist, cdist, squareform +from scipy.spatial.distance import cdist, pdist, squareform from scipy.stats import binned_statistic, binned_statistic_2d, binned_statistic_dd from skimage.draw import disk @@ -2275,9 +2275,7 @@ def neff_hugonnet_approx( else: # Vectorized calculation var = np.sum( - errors.reshape((-1, 1)) - @ sub_errors.reshape((1, -1)) - * rho(pds_matrix.flatten()).reshape(pds_matrix.shape) + errors.reshape((-1, 1)) @ sub_errors.reshape((1, -1)) * rho(pds_matrix.flatten()).reshape(pds_matrix.shape) ) # The number of effective sample is the fraction of total sill by squared standard error