Fix usages of deprecated features.
This MR updates the usage points of several deprecated features of our dependencies.
- Scipy subnamespaces
ndimage.filters
andndimage.morphology
have been deprecated for a while -
np.trapz
is replaced bynp.trapezoid
in numpy 2.0 (https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#main-namespace) - Path-like arguments in pytest have been switched to
pathlib
a long time ago (https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path and https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path) - Fix
MatplotlibDeprecationWarning: Auto-close()ing of figures upon backend switching is deprecated since 3.8 and will be removed two minor releases later. To suppress this warning, explicitly call plt.close('all') first.
by closing all open figures before and after any notebook run
Maybe (just maybe) the closing of figures also fixes this spurious error:
FAILED tests/test_stokes_setup.ipynb::test_stokes_setup.ipynb - TypeError: Axes3D.quiver() missing 4 required positional arguments: 'Z', 'U', 'V', and 'W'
for which I still could not pin down the cause.
Edited by Frederik Hennig