Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-scikit-image for 
openSUSE:Factory checked in at 2026-09-12 21:21:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-scikit-image (Old)
 and      /work/SRC/openSUSE:Factory/.python-scikit-image.new.1265 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-scikit-image"

Sat Sep 12 21:21:21 2026 rev:30 rq:1377432 version:0.26.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-scikit-image/python-scikit-image.changes  
2026-05-28 17:29:28.262007119 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-scikit-image.new.1265/python-scikit-image.changes
        2026-09-12 21:25:09.662040819 +0200
@@ -1,0 +2,9 @@
+Fri Sep 11 14:41:51 UTC 2026 - Markéta Machová <[email protected]>
+
+- Add few upstream patches to make tests pass:
+  * scipy118.patch
+  * numpy25.patch
+  * ellipse.patch
+  * scipy-spatial.patch
+
+-------------------------------------------------------------------

New:
----
  ellipse.patch
  numpy25.patch
  scipy-spatial.patch
  scipy118.patch

----------(New B)----------
  New:  * numpy25.patch
  * ellipse.patch
  * scipy-spatial.patch
  New:  * scipy118.patch
  * numpy25.patch
  * ellipse.patch
  New:  * ellipse.patch
  * scipy-spatial.patch
  New:- Add few upstream patches to make tests pass:
  * scipy118.patch
  * numpy25.patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-scikit-image.spec ++++++
--- /var/tmp/diff_new_pack.BccSG4/_old  2026-09-12 21:25:11.270108311 +0200
+++ /var/tmp/diff_new_pack.BccSG4/_new  2026-09-12 21:25:11.280108731 +0200
@@ -38,11 +38,19 @@
 Source0:        
https://files.pythonhosted.org/packages/source/s/scikit-image/%{srcname}-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM Based on gh#scikit-image/scikit-image#8010
 Patch0:         support-new-pillow.patch
+# PATCH-FIX-UPSTREAM https://github.com/scikit-image/scikit-image/pull/8157 
Fix minkowski distanced invocation for SciPy >= 1.18
+Patch1:         scipy118.patch
+# PATCH-FIX-UPSTREAM https://github.com/scikit-image/scikit-image/pull/8020 
Avoid deprecated assign to ndarray.shape
+Patch2:         numpy25.patch
+# PATCH-FIX-UPSTREAM https://github.com/scikit-image/scikit-image/pull/8054 
MAINT: make ellipse fitting forward compatible
+Patch3:         ellipse.patch
+# PATCH-FIX-UPSTREAM 
https://github.com/scikit-image/scikit-image/commit/a6a9591dd122d4fe259a5aab881808883797082c
 Fix nightlies: update deprecated scipy call, fix underdetermined test
+Patch4:         scipy-spatial.patch
 BuildRequires:  %{python_module Cython >= 3.0.4}
 BuildRequires:  %{python_module devel >= 3.10}
 BuildRequires:  %{python_module meson-python >= 0.15}
-BuildRequires:  %{python_module numpy-devel >= 1.24}
-BuildRequires:  %{python_module packaging >= 21}
+BuildRequires:  %{python_module numpy-devel >= 2.1}
+BuildRequires:  %{python_module packaging >= 24}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pythran}
 BuildRequires:  %{python_module setuptools}
@@ -55,24 +63,24 @@
 Requires:       python-imageio >= 2.33
 Requires:       python-lazy-loader >= 0.4
 Requires:       python-networkx >= 3
-Requires:       python-numpy >= 1.24
-Requires:       python-packaging >= 21.0
-Requires:       python-scipy >= 1.11.4
-Requires:       python-tifffile >= 2022.8.12
+Requires:       python-numpy >= 2.1
+Requires:       python-packaging >= 24.0
+Requires:       python-scipy >= 1.15
+Requires:       python-tifffile >= 2025.1.10
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
-Recommends:     python-PyWavelets >= 1.6
+Recommends:     python-PyWavelets >= 1.7
 Recommends:     python-QtPy
 Recommends:     python-SimpleITK
-Recommends:     python-astropy >= 5
+Recommends:     python-astropy >= 6.1
 Recommends:     python-cloudpickle >= 1.1.1
-Recommends:     python-dask-array >= 2023.2.0
-Recommends:     python-matplotlib >= 3.7
+Recommends:     python-dask-array >= 2025.1.0
+Recommends:     python-matplotlib >= 3.10
 Recommends:     python-pooch >= 1.6.0
 Recommends:     python-pyamg >= 5.2
 %if %{with test}
-BuildRequires:  %{python_module dask-array >= 2023.2.0}
-BuildRequires:  %{python_module matplotlib >= 3.7}
+BuildRequires:  %{python_module dask-array >= 2025.1.0}
+BuildRequires:  %{python_module matplotlib >= 3.10}
 BuildRequires:  %{python_module numpydoc >= 1.7}
 BuildRequires:  %{python_module pytest >= 8}
 BuildRequires:  %{python_module pytest-localserver}

++++++ ellipse.patch ++++++
>From b9b377cb403284954533b4cc2e61543a79e2d04c Mon Sep 17 00:00:00 2001
From: Evgeni Burovski <[email protected]>
Date: Fri, 6 Mar 2026 09:01:52 +0100
Subject: [PATCH] MAINT: make ellipse fitting forward compatible  (#8054)

NumPy plans to change it's `linalg.eig` routine to always return complex
results. Currently, it returns either complex or real values,
depending on whether the eigenvalues lie on the real axis or not.
See https://github.com/numpy/numpy/pull/30411

The only effect on scikit-image AFAICS, is in the ellipse estimation
routines, which require that eigenvalues are real. In fact, the story
seems to be somewhat convoluted:
- some datasets produce non-zero imaginary parts, which break 
`EllipseModel.fit`,
https://github.com/scikit-image/scikit-image/issues/7013
- the current failure mode is a TypeError from an in-place modulo operation,
`phi %= np.pi`, where `phi` is constructed from eigenvalues/eigenvectors
- 
https://github.com/scikit-image/scikit-image/issues/7013#issuecomment-1583203321
asks for a reproducer, and
https://github.com/numpy/numpy/issues/29000#issuecomment-3414690376 has
some discussion of potential fixes/enhancements

This PR makes a minimal fix to make `EllipseModel.fit`: take the real
part of eigenvalues/eigenvectors explicitly, and raise an error if
either of them has non-zero imaginary parts.

---------

Co-authored-by: Stefan van der Walt <[email protected]>
---
 src/skimage/measure/fit.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/skimage/measure/fit.py b/src/skimage/measure/fit.py
index 62aec90f79b..1cc8d678c9d 100644
--- a/src/skimage/measure/fit.py
+++ b/src/skimage/measure/fit.py
@@ -904,6 +904,17 @@ def _estimate(self, data, warn_only=True):
         # from this equation [eqn. 28]
         eig_vals, eig_vecs = np.linalg.eig(M)
 
+        # https://github.com/scikit-image/scikit-image/issues/7013
+        if not (np.all(np.isreal(eig_vals)) and np.all(np.isreal(eig_vecs))):
+            raise ValueError(
+                "Uh oh! We expected real eigenvalues and -vectors. "
+                "We've had one report of this issue in the past, but couldn't 
reproduce it. "
+                "Please help us fix it by sharing your input data at\n\n"
+                "  https://github.com/scikit-image/scikit-image/issues/7013\n";
+            )
+        eig_vals = eig_vals.real
+        eig_vecs = eig_vecs.real
+
         # eigenvector must meet constraint 4ac - b^2 to be valid.
         cond = 4 * np.multiply(eig_vecs[0, :], eig_vecs[2, :]) - np.power(
             eig_vecs[1, :], 2

++++++ numpy25.patch ++++++
>From 7737c0446bb30ca14782b488ce2399c7c752f640 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <[email protected]>
Date: Fri, 6 Mar 2026 00:39:28 +0100
Subject: [PATCH] Avoid deprecated assign to ndarray.shape (#8020)

We also had to update our minimum requirements to get everything running 
smoothly (certain versions of NumPy didn't have the `copy` flag yet, and once 
that version of NumPy becomes the minimum there's a cascade of dependency 
updates).

Pyodide now depends on a different version of SciPy than the rest of the 
library, since it doesn't yet have SciPy 1.15.

Closes #8019
Closes #8025
---------

Co-authored-by: Stefan van der Walt <[email protected]>
Co-authored-by: Stefan van der Walt <[email protected]>
---
 .github/workflows/test-pyodide.yaml           |  4 +--
 environment.yml                               | 28 +++++++--------
 meson.options                                 |  6 ----
 pyproject.toml                                | 34 ++++++++++---------
 requirements/default.txt                      |  9 ++---
 requirements/docs.txt                         | 10 +++---
 requirements/optional.txt                     | 10 +++---
 requirements/optional_free_threaded.txt       |  8 ++---
 src/meson.build                               |  7 +---
 src/skimage/feature/sift.py                   |  4 +--
 src/skimage/graph/_mcp.pyx                    |  2 +-
 src/skimage/io/_plugins/pil_plugin.py         |  2 +-
 .../measure/_marching_cubes_lewiner.py        |  4 +--
 src/skimage/morphology/grayreconstruct.py     |  4 ++-
 src/skimage/restoration/_rolling_ball_cy.pyx  |  4 +--
 src/skimage/util/_map_array.py                |  2 +-
 tools/generate_requirements.py                |  4 +++
 17 files changed, 70 insertions(+), 72 deletions(-)
 delete mode 100644 meson.options

Index: scikit_image-0.26.0/meson.options
===================================================================
--- scikit_image-0.26.0.orig/meson.options
+++ /dev/null
@@ -1,6 +0,0 @@
-option(
-  'include-v2',
-  type: 'boolean',
-  value: true,
-  description: 'Include skimage2 namespace in the built package'
-)
Index: scikit_image-0.26.0/pyproject.toml
===================================================================
--- scikit_image-0.26.0.orig/pyproject.toml
+++ scikit_image-0.26.0/pyproject.toml
@@ -202,6 +203,10 @@ filterwarnings = [
     # Pyodide warning coming via threadpoolctl, remove when
     # https://github.com/joblib/threadpoolctl/pull/201 is released
     "ignore:.*JsProxy\\.as_object_map.*:RuntimeWarning",
+    # Warning caused by matplotlib 3.7.0 because it uses deprecated API of 
pyparsing 3.3.1
+    
"ignore:.*(parseString|resetCache|enablePackrat|oneOf).*:DeprecationWarning:matplotlib",
+    # tifffile (v2025.12.20) uses deprecated NumPy API
+    "ignore:Setting the shape on a NumPy array:DeprecationWarning:tifffile",
 ]
 norecursedirs = ["io/_plugins"]
 
@@ -226,7 +231,6 @@ build-verbosity = 0
 enable="cpython-freethreading"
 
 [tool.cibuildwheel.config-settings]
-setup-args = "-Dinclude-v2=false"
 # Could be overwritten using CIBW_CONFIG_SETTINGS environment variable
 
 [[tool.cibuildwheel.overrides]]
Index: scikit_image-0.26.0/src/meson.build
===================================================================
--- scikit_image-0.26.0.orig/src/meson.build
+++ scikit_image-0.26.0/src/meson.build
@@ -1,7 +1,2 @@
-include_v2 = get_option('include-v2')
-
 subdir('skimage')
-
-if include_v2
-  subdir('skimage2')
-endif
+subdir('skimage2')
Index: scikit_image-0.26.0/src/skimage/feature/sift.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/feature/sift.py
+++ scikit_image-0.26.0/src/skimage/feature/sift.py
@@ -304,7 +304,7 @@ class SIFT(FeatureDetector, DescriptorEx
             mode='reflect',
         )
 
-        # Eq. 10:  sigmas.shape = (n_octaves, n_scales + 3).
+        # Eq. 10:  sigmas.reshape((n_octaves, n_scales + 3), copy=False).
         # The three extra scales are:
         #    One for the differences needed for DoG and two auxiliary
         #    images (one at either end) for peak_local_max with exclude
@@ -317,7 +317,7 @@ class SIFT(FeatureDetector, DescriptorEx
         self.scalespace_sigmas = sigmas
 
         # Eq. 7: Gaussian smoothing depends on difference with previous sigma
-        #        gaussian_sigmas.shape = (n_octaves, n_scales + 2)
+        #        gaussian_sigmas.reshape((n_octaves, n_scales + 2), copy=False)
         var_diff = np.diff(sigmas * sigmas, axis=1)
         gaussian_sigmas = np.sqrt(var_diff) / self.deltas[:, np.newaxis]
 
Index: scikit_image-0.26.0/src/skimage/graph/_mcp.pyx
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/graph/_mcp.pyx
+++ scikit_image-0.26.0/src/skimage/graph/_mcp.pyx
@@ -77,7 +77,7 @@ def _offset_edge_map(shape, offsets):
           [0, 0, 2, 1]], dtype=int8)
 
     """
-    indices = np.indices(shape)  # indices.shape = (n,)+shape
+    indices = np.indices(shape)  # indices.reshape((n,) + shape, copy=False)
 
     #get the distance from each index to the upper or lower edge in each dim
     pos_edges = (shape - indices.T).T
Index: scikit_image-0.26.0/src/skimage/io/_plugins/pil_plugin.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/io/_plugins/pil_plugin.py
+++ scikit_image-0.26.0/src/skimage/io/_plugins/pil_plugin.py
@@ -109,7 +109,7 @@ def pil_to_ndarray(image, dtype=None, im
             if 'S' in image.mode:
                 dtype = dtype.replace('u', 'i')
             frame = np.frombuffer(frame.tobytes(), dtype)
-            frame.shape = shape[::-1]
+            frame = np.reshape(frame, shape[::-1], copy=False)
 
         else:
             frame = np.array(frame, dtype=dtype)
Index: scikit_image-0.26.0/src/skimage/measure/_marching_cubes_lewiner.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/measure/_marching_cubes_lewiner.py
+++ scikit_image-0.26.0/src/skimage/measure/_marching_cubes_lewiner.py
@@ -210,7 +210,7 @@ def _marching_cubes_lewiner(
     normals = np.fliplr(normals)
 
     # Finishing touches to output
-    faces.shape = -1, 3
+    faces = np.reshape(faces, (-1, 3), copy=False)
     if gradient_direction == 'descent':
         # MC implementation is right-handed, but gradient_direction is
         # left-handed
@@ -234,7 +234,7 @@ def _to_array(args):
     shape, text = args
     byts = base64.decodebytes(text.encode('utf-8'))
     ar = np.frombuffer(byts, dtype='int8')
-    ar.shape = shape
+    ar = np.reshape(ar, shape, copy=False)
     return ar
 
 
Index: scikit_image-0.26.0/src/skimage/morphology/grayreconstruct.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/morphology/grayreconstruct.py
+++ scikit_image-0.26.0/src/skimage/morphology/grayreconstruct.py
@@ -213,5 +213,7 @@ def reconstruction(seed, mask, method='d
 
     # Reshape reconstructed image to original image shape and remove padding.
     rec_img = value_map[value_rank[:image_stride]]
-    rec_img.shape = np.array(seed.shape) + (np.array(footprint.shape) - 1)
+    rec_img = np.reshape(
+        rec_img, np.array(seed.shape) + (np.array(footprint.shape) - 1), 
copy=False
+    )
     return rec_img[inside_slices]
Index: scikit_image-0.26.0/src/skimage/restoration/_rolling_ball_cy.pyx
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/restoration/_rolling_ball_cy.pyx
+++ scikit_image-0.26.0/src/skimage/restoration/_rolling_ball_cy.pyx
@@ -112,7 +112,7 @@ def apply_kernel_nan(DTYPE_FLOAT[::1] im
     -------
     out_data : ndarray
         The array passed into ``out``, reshaped to
-        ``out_data.shape = img_shape`` (possibly a view) and filled with the
+        ``out_data.reshape(img_shape, copy=False)`` (possibly a view) and 
filled with the
         estimated background intensity.
 
     See Also
@@ -196,7 +196,7 @@ def apply_kernel(DTYPE_FLOAT[::1] img no
     -------
     out_data : ndarray
         The array passed into ``out``, reshaped to
-        ``out_data.shape = img_shape`` (possibly a view) and filled with the
+        ``out_data.reshape(img_shape, copy=False)`` (possibly a view) and 
filled with the
         estimated background intensity.
 
     See Also
Index: scikit_image-0.26.0/src/skimage/util/_map_array.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/util/_map_array.py
+++ scikit_image-0.26.0/src/skimage/util/_map_array.py
@@ -58,7 +58,7 @@ def map_array(input_arr, input_vals, out
         )
     try:
         out_view = out.view()
-        out_view.shape = (-1,)  # no-copy reshape/ravel
+        out_view = np.reshape(out_view, (-1,), copy=False)
     except AttributeError:  # if out strides are not compatible with 0-copy
         raise ValueError(
             'If out array is provided, it should be either contiguous '
Index: scikit_image-0.26.0/tools/generate_requirements.py
===================================================================
--- scikit_image-0.26.0.orig/tools/generate_requirements.py
+++ scikit_image-0.26.0/tools/generate_requirements.py
@@ -58,6 +58,10 @@ def generate_environment_yml(req_section
 
             lines.append(f"  - {dep}")
 
+            # Strip duplicates
+            if re.split('[>=]', lines[-2])[0] == re.split('[>=]', 
lines[-1])[0]:
+                lines = lines[:-1]
+
     with open("environment.yml", "w") as f:
         f.writelines(f"{line}\n" for line in lines)
 

++++++ scipy-spatial.patch ++++++
>From a6a9591dd122d4fe259a5aab881808883797082c Mon Sep 17 00:00:00 2001
From: Steven Silvester <[email protected]>
Date: Wed, 13 May 2026 12:48:18 -0500
Subject: [PATCH] Fix nightlies: update deprecated scipy call, fix
 underdetermined test

- Replace deprecated usages of `scipy` `distance_matrix` function by 
`spatial.distance.cdist`.
- Update `test_polynomial_weighted_estimation` to be robust. Previously had an 
under-determined system (third degree polynomial, with only eight data points).
---
 src/skimage/measure/fit.py                   |  1 +
 src/skimage/transform/_thin_plate_splines.py |  6 +++---
 tests/skimage/transform/test_geometric.py    | 12 +++++++-----
 3 files changed, 11 insertions(+), 8 deletions(-)

Index: scikit_image-0.26.0/src/skimage/measure/fit.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/measure/fit.py
+++ scikit_image-0.26.0/src/skimage/measure/fit.py
@@ -621,6 +621,7 @@ class CircleModel(_BaseModel):
                 warn_only=warn_only,
             )
 
+        # Compute the Euclidean distances from the center.
         center = C[0:2]
         # Can remove once SciPy 1.18 is the default
         if version.parse(scipy.__version__) >= version.parse('1.18.0dev0'):
Index: scikit_image-0.26.0/src/skimage/transform/_thin_plate_splines.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/transform/_thin_plate_splines.py
+++ scikit_image-0.26.0/src/skimage/transform/_thin_plate_splines.py
@@ -1,7 +1,7 @@
 from typing import Self
 
 import numpy as np
-from scipy.spatial import distance_matrix
+from scipy.spatial.distance import cdist
 
 from .._shared.utils import check_nD, _deprecate_estimate, FailedEstimation
 
@@ -180,7 +180,7 @@ class ThinPlateSplineTransform:
         self.src = src
         n, d = src.shape
 
-        dist = distance_matrix(src, src)
+        dist = cdist(src, src)
         K = self._radial_basis_kernel(dist)
         P = np.hstack([np.ones((n, 1)), src])
         n_plus_3 = n + 3
@@ -197,7 +197,7 @@ class ThinPlateSplineTransform:
 
     def _radial_distance(self, coords):
         """Compute the radial distance between input points and source 
points."""
-        dists = distance_matrix(coords, self.src)
+        dists = cdist(coords, self.src)
         return self._radial_basis_kernel(dists)
 
     def _spline_function(self, coords, radial_dist):
Index: scikit_image-0.26.0/tests/skimage/transform/test_geometric.py
===================================================================
--- scikit_image-0.26.0.orig/tests/skimage/transform/test_geometric.py
+++ scikit_image-0.26.0/tests/skimage/transform/test_geometric.py
@@ -861,10 +861,12 @@ def test_polynomial_estimation():
 
 
 def test_polynomial_weighted_estimation():
-    # Over-determined solution with same points, and unity weights
-    tform = estimate_transform('polynomial', SRC, DST, order=10)
+    # Use order=2 so the system is over-determined with 8 points:
+    # A has shape (16, 13), giving a unique least-squares solution.
+    # order=3 would require > 20 rows (i.e. > 10 points) to be over-determined.
+    tform = estimate_transform('polynomial', SRC, DST, order=2)
     tform_w = estimate_transform(
-        'polynomial', SRC, DST, order=10, weights=np.ones(SRC.shape[0])
+        'polynomial', SRC, DST, order=2, weights=np.ones(SRC.shape[0])
     )
     assert_almost_equal(tform.params, tform_w.params)
 
@@ -872,12 +874,12 @@ def test_polynomial_weighted_estimation(
     # the same result.
     point_weights = np.ones(SRC.shape[0] + 1)
     point_weights[0] = 1.0e-15
-    tform1 = estimate_transform('polynomial', SRC, DST, order=10)
+    tform1 = estimate_transform('polynomial', SRC, DST, order=2)
     tform2 = estimate_transform(
         'polynomial',
         SRC[np.arange(-1, SRC.shape[0]), :],
         DST[np.arange(-1, SRC.shape[0]), :],
-        order=10,
+        order=2,
         weights=point_weights,
     )
     assert_almost_equal(tform1.params, tform2.params, decimal=4)

++++++ scipy118.patch ++++++
>From 3f8abbeb7fb87669e5d5620f0d4f38379b3e4641 Mon Sep 17 00:00:00 2001
From: Stefan van der Walt <[email protected]>
Date: Wed, 13 May 2026 06:09:09 -0700
Subject: [PATCH] Fix minkowski distanced invocation for SciPy >= 1.18 (#8157)

SciPy now raises a warning for `spatial.minkowski_distance`, need to use
`spatial.distance.minkowski` instead.

Without this fix, we don't build nightlies.
---
 TODO.txt                   |  2 ++
 src/skimage/measure/fit.py | 11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

Index: scikit_image-0.26.0/TODO.txt
===================================================================
--- scikit_image-0.26.0.orig/TODO.txt
+++ scikit_image-0.26.0/TODO.txt
@@ -42,6 +42,8 @@ Other
   `scipy.linalg.eigsh` is available everywhere, remove the compatibility logic 
in
   `skimage/graph/_graph_cut.py::_ncut_relabel` and the `xfail` mark in
   `tests/skimage/graph/test_rag.py::test_reproducibility`.
+* Once SciPy 1.18 is minimal required version, remove minkowski
+  distance branching from `src/skimage/measure/fit.py`.
 
 Post numpy 2
 ------------
Index: scikit_image-0.26.0/src/skimage/measure/fit.py
===================================================================
--- scikit_image-0.26.0.orig/src/skimage/measure/fit.py
+++ scikit_image-0.26.0/src/skimage/measure/fit.py
@@ -5,7 +5,8 @@ from warnings import warn, catch_warning
 
 import numpy as np
 from numpy.linalg import inv
-from scipy import optimize, spatial
+from packaging import version
+import scipy
 
 from .._shared.utils import (
     _deprecate_estimate,
@@ -621,7 +622,11 @@ class CircleModel(_BaseModel):
             )
 
         center = C[0:2]
-        distances = spatial.minkowski_distance(center, data)
+        # Can remove once SciPy 1.18 is the default
+        if version.parse(scipy.__version__) >= version.parse('1.18.0dev0'):
+            distances = scipy.spatial.distance.minkowski(center, data)
+        else:
+            distances = scipy.spatial.minkowski_distance(center, data)
         r = np.sqrt(np.mean(distances**2))
 
         # Revert normalization and set init params.
@@ -1022,7 +1027,7 @@ class EllipseModel(_BaseModel):
             xi = x[i]
             yi = y[i]
             # faster without Dfun, because of the python overhead
-            t, _ = optimize.leastsq(fun, t0[i], args=(xi, yi))
+            t, _ = scipy.optimize.leastsq(fun, t0[i], args=(xi, yi))
             residuals[i] = np.sqrt(fun(t, xi, yi))
 
         return residuals

Reply via email to