xdem
xdem copied to clipboard
Finish removing NMAD from `xdem.spatialstats`
It seems like there are many instances that weren't removed in #716. The pytest warnings show the number of calls which is quite massive:
tests/test_spatialstats.py: 484 warnings
/home/runner/miniconda3/envs/xdem-dev/lib/python3.10/site-packages/scipy/stats/_binned_statistic.py:694: DeprecationWarning: Call to deprecated function 'nmad'. Xdem.spatialstats.nmad is being deprecated in favor of geoutils.stats.nmad. This functionality will be removed in version 0.4.
stat = stat_func(np.array(bin_map[i]))
tests/test_spatialstats.py: 3460 warnings
/home/runner/work/xdem/xdem/xdem/spatialstats.py:2680: DeprecationWarning: Call to deprecated function 'nmad'. Xdem.spatialstats.nmad is being deprecated in favor of geoutils.stats.nmad. This functionality will be removed in version 0.4.
statistic = statistic_between_patches(mean_img[i::kernel_size, j::kernel_size].ravel())
Almost 4000 warnings in total.
Here's an example: https://github.com/GlacioHack/xdem/blob/e1e2065ea52a7db3c8e88045d743aa1f6efd08bb/examples/advanced/plot_variogram_estimation_modelling.py#L49
@adebardo Tell me if I should finalize this or if you want to take it
I can do it :)
Closed by #732