xdem icon indicating copy to clipboard operation
xdem copied to clipboard

Finish removing NMAD from `xdem.spatialstats`

Open rhugonnet opened this issue 8 months ago • 2 comments

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

rhugonnet avatar May 06 '25 17:05 rhugonnet

@adebardo Tell me if I should finalize this or if you want to take it

rhugonnet avatar May 06 '25 17:05 rhugonnet

I can do it :)

adebardo avatar May 07 '25 07:05 adebardo

Closed by #732

rhugonnet avatar May 28 '25 08:05 rhugonnet