diff --git a/skimage/graph/_mcp.pyx b/skimage/graph/_mcp.pyx index 5669c7d0..047f12b4 100644 --- a/skimage/graph/_mcp.pyx +++ b/skimage/graph/_mcp.pyx @@ -36,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import cython import numpy as np import heap -import warnings +from .._shared.utils import warn cimport numpy as cnp cimport heap @@ -304,7 +304,8 @@ cdef class MCP: self.flat_costs = costs.astype(FLOAT_D, copy=False).ravel('F') except TypeError: self.flat_costs = costs.astype(FLOAT_D).flatten('F') - warnings.warn('Upgrading NumPy should decrease memory usage and increase speed.', Warning, stacklevel=2) + warn('Upgrading NumPy should decrease memory usage and increase' + ' speed.') size = self.flat_costs.shape[0] self.flat_cumulative_costs = np.empty(size, dtype=FLOAT_D) self.dim = len(costs.shape)