commit python-scikit-image for openSUSE:Factory
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 2024-06-07 15:05:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-scikit-image (Old) and /work/SRC/openSUSE:Factory/.python-scikit-image.new.24587 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-scikit-image" Fri Jun 7 15:05:24 2024 rev:20 rq:1179164 version:0.23.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-scikit-image/python-scikit-image.changes 2024-03-20 21:16:58.059826640 +0100 +++ /work/SRC/openSUSE:Factory/.python-scikit-image.new.24587/python-scikit-image.changes 2024-06-07 15:06:02.933635306 +0200 @@ -1,0 +2,97 @@ +Thu Jun 6 17:13:16 UTC 2024 - Ben Greiner <code@bnavigator.de> + +- Add skimage-pr7414-np2.patch gh#scikit-image/scikit-image#7414 + +------------------------------------------------------------------- +Sun May 5 14:31:34 UTC 2024 - Ben Greiner <code@bnavigator.de> + +- Update to 0.23.2 + ## Bug Fixes + * Make sure skimage.util.img_as_ubyte supports the edge case + where dtype('uint64').type of the provided image is + np.ulonglong instead of np.uint64 (#7392). + ## Documentation + * Add date to 0.23.1 release notes (#7384). + * Fix docstring of connectivity parameter in + skimage.segmentation.watershed (#7360). + ## Infrastructure + * Ignore Sphinx warning about unpickable cache (#7400). + * Simplify instructions on changelist in PR template (#7401). + ## Maintenance + * Use numpy.inf instead of deprecated numpy.infty (#7386). + * Update Ruff config (#7387). + * Update matrix and names of Azure pipelines configuration + (#7390). + * Use upload- and download-artifact v4 (#7389). + * Ignore arch specific cast warnings originating from astype in + tests (#7393). + * Update link to numpydoc example.py (#7395). +- Release 0.23.1/0.23.0 + ## Highlights + * Ensure skimage.morphology.closing and + skimage.morphology.opening are extensive and anti-extensive, + respectively, if the footprint is not mirror symmetric (#6695). + * Add parameter mode to binary_erosion, binary_dilation, + binary_opening and binary_closing in skimage.morphology. These + new parameters determine how array borders are handled (#6695). + * Add parameters mode and cval to erosion, dilation, opening, + closing, white_tophat, and black_tophat in skimage.morphology. + These new parameters determine how array borders are handled + (#6695). + * Speedup skimage.util.map_array by parallelization with Cython's + prange (#7266). + ## New Features + * Add new intensity_std property to skimage.measure.regionprops + which computes the standard deviation of the intensity in a + region (#6712). + * Add parameter mode to binary_erosion, binary_dilation, + binary_opening and binary_closing in skimage.morphology. These + new parameters determine how array borders are handled (#6695). + * Add functions mirror_footprint and pad_footprint to + skimage.morphology (#6695). + * Add parameters mode and cval to erosion, dilation, opening, + closing, white_tophat, and black_tophat in skimage.morphology. + These new parameters determine how array borders are handled + (#6695). + * Add new parameter spacing to segmentation.expand_labels to + support anisotropic images (#7080). + ## API Changes + * Drop support for Python 3.9 (#7217). + * Parameters shift_x and shift_y in skimage.morphology.erosion + and skimage.morphology.dilation are deprecated. Use + pad_footprint or modify the footprint manually instead (#6695). + * Remove unexpected value scaling in + skimage.morphology.skeletonize_3d for non-binary input images. + skeletonize_3d now always returns a binary array like similar + functions (#7095). + * Deprecate function skimage.feature.plot_matches in favor of + skimage.feature.plot_matched_features (#7255). + * Deprecate skimage.morphology.skeletonize_3d in favor of just + skimage.morphology.skeletonize (#7094). + * Deprecate parameter output in skimage.filters.gaussian; use out + instead (#7225). + * Change the default value of the parameters shift_x, shift_y and + shift_z from False to 0 in the skimage.filters.rank functions. + This has not impact on the results. Warn in case boolean shifts + are provided from now on (#7320). + * Performance + * Add lazy loading to skimage.metrics module (#7211). + * Speedup skimage.util.map_array by parallelization with Cython's + prange (#7266). + ## Bug Fixes + * Add exception to avoid surprising result when image is too + small for the given parameters in skimage.feature.hog (#7153). + * Ensure skimage.morphology.closing and + skimage.morphology.opening are extensive and anti-extensive, + respectively, if the footprint is not mirror symmetric (#6695). + * Avoid a TypeError in + skimage.registration.phase_cross_correlation when the real-time + shift cannot be determined (disambiguate=True). Display a + warning instead (#7259). + * Fix logic in skimage.graph.pixel_graph which raised a TypeError + when the parameter edge_function was provided without a mask + (#7310). + * Ensure cache stays empty when cache=False is passed to + skimage.measure.regionprops (#7333). + +------------------------------------------------------------------- Old: ---- scikit_image-0.22.0.tar.gz New: ---- scikit_image-0.23.2.tar.gz skimage-pr7414-np2.patch BETA DEBUG BEGIN: New: - Add skimage-pr7414-np2.patch gh#scikit-image/scikit-image#7414 BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-scikit-image.spec ++++++ --- /var/tmp/diff_new_pack.2A9QLh/_old 2024-06-07 15:06:04.117678440 +0200 +++ /var/tmp/diff_new_pack.2A9QLh/_new 2024-06-07 15:06:04.121678586 +0200 @@ -26,16 +26,19 @@ %bcond_with test %endif Name: python-scikit-image%{psuffix} -Version: 0.22.0 +Version: 0.23.2 Release: 0 Summary: Collection of algorithms for image processing in Python License: BSD-3-Clause URL: https://scikit-image.org/ +# SourceRepository: https://github.com/scikit-image/scikit-image Source0: https://files.pythonhosted.org/packages/source/s/scikit-image/%{srcname}-%{version}.tar.gz -BuildRequires: %{python_module Cython >= 0.29.21} -BuildRequires: %{python_module devel >= 3.7} -BuildRequires: %{python_module meson-python} -BuildRequires: %{python_module numpy-devel >= 1.21.1} +# PATCH-FIX-UPSTREAM skimage-pr7414-np2.patch gh#scikit-image/scikit-image#7414 +Patch0: https://github.com/scikit-image/scikit-image/pull/7414.patch#/skimage-pr7414... +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.23} BuildRequires: %{python_module packaging >= 20} BuildRequires: %{python_module pip} BuildRequires: %{python_module pythran} @@ -45,14 +48,14 @@ BuildRequires: freeimage-devel BuildRequires: gcc-c++ BuildRequires: python-rpm-macros -Requires: python-Pillow >= 9.0.1 +Requires: python-Pillow >= 9.1 Requires: python-PyWavelets >= 1.1.1 -Requires: python-imageio >= 2.7 -Requires: python-lazy-loader >= 0.2 +Requires: python-imageio >= 2.33 +Requires: python-lazy-loader >= 0.4 Requires: python-networkx >= 2.8 -Requires: python-numpy >= 1.21.1 +Requires: python-numpy >= 1.23 Requires: python-packaging >= 21.0 -Requires: python-scipy >= 1.8 +Requires: python-scipy >= 1.9 Requires: python-tifffile >= 2022.8.12 Requires(post): update-alternatives Requires(postun): update-alternatives @@ -62,12 +65,12 @@ Recommends: python-cloudpickle >= 0.2.1 Recommends: python-dask-array >= 1.0.0 Recommends: python-imread >= 0.5.1 -Recommends: python-matplotlib >= 3.0.3 +Recommends: python-matplotlib >= 3.6 Recommends: python-pooch >= 1.3.0 Recommends: python-pyamg %if %{with test} BuildRequires: %{python_module dask-array >= 1.0.0} -BuildRequires: %{python_module matplotlib >= 3.0.3} +BuildRequires: %{python_module matplotlib >= 3.6} BuildRequires: %{python_module numpydoc} BuildRequires: %{python_module pytest >= 4.0} BuildRequires: %{python_module pytest-localserver} @@ -85,6 +88,7 @@ %if !%{with test} %autosetup -p1 -n %{srcname}-%{version} sed -Ei "1{s@/usr/bin/env python@%{_bindir}/python3@}" ./skimage/_build_utils/*.py +chmod -x skimage/measure/{__init__,_find_contours}.py %else %setup -q -c scikit-image-%{version}-test -D -T %endif @@ -97,9 +101,7 @@ %install %if !%{with test} %pyproject_install -%{python_expand %fdupes %{buildroot}%{$python_sitearch} -chmod -x %{buildroot}%{$python_sitearch}/skimage/measure/{__init__,_find_contours}.py -} +%python_expand %fdupes %{buildroot}%{$python_sitearch} %endif %if %{with test} ++++++ scikit_image-0.22.0.tar.gz -> scikit_image-0.23.2.tar.gz ++++++ /work/SRC/openSUSE:Factory/python-scikit-image/scikit_image-0.22.0.tar.gz /work/SRC/openSUSE:Factory/.python-scikit-image.new.24587/scikit_image-0.23.2.tar.gz differ: char 5, line 1 ++++++ skimage-pr7414-np2.patch ++++++ From 24e84822508a886c0433875889608f7aa31848ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <lagru@mailbox.org> Date: Tue, 7 May 2024 20:07:48 +0200 Subject: [PATCH 1/5] Fix NumPy2 dtype promotion issues in pywt dependent code --- skimage/metrics/simple_metrics.py | 1 + skimage/restoration/_denoise.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/skimage/metrics/simple_metrics.py b/skimage/metrics/simple_metrics.py index 37cd69ee1c9..7bb13acf189 100644 --- a/skimage/metrics/simple_metrics.py +++ b/skimage/metrics/simple_metrics.py @@ -164,6 +164,7 @@ def peak_signal_noise_ratio(image_true, image_test, *, data_range=None): image_true, image_test = _as_floats(image_true, image_test) err = mean_squared_error(image_true, image_test) + data_range = float(data_range) # prevent overflow for small integer types return 10 * np.log10((data_range**2) / err) diff --git a/skimage/restoration/_denoise.py b/skimage/restoration/_denoise.py index 791a8c9f25b..4f4a235ac40 100644 --- a/skimage/restoration/_denoise.py +++ b/skimage/restoration/_denoise.py @@ -788,7 +788,9 @@ def _wavelet_threshold( for thresh, level in zip(threshold, dcoeffs) ] denoised_coeffs = [coeffs[0]] + denoised_detail - return pywt.waverecn(denoised_coeffs, wavelet)[original_extent] + out = pywt.waverecn(denoised_coeffs, wavelet)[original_extent] + out = out.astype(image.dtype) + return out def _scale_sigma_and_image_consistently(image, sigma, multichannel, rescale_sigma): From bfbf88aad4fbd04b3657c682266d43aa0fe01ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <lagru+github@mailbox.org> Date: Wed, 8 May 2024 00:17:00 +0200 Subject: [PATCH 2/5] Update skimage/metrics/simple_metrics.py Co-authored-by: Mark Harfouche <mark.harfouche@gmail.com> --- skimage/metrics/simple_metrics.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/skimage/metrics/simple_metrics.py b/skimage/metrics/simple_metrics.py index 7bb13acf189..6a255ed4211 100644 --- a/skimage/metrics/simple_metrics.py +++ b/skimage/metrics/simple_metrics.py @@ -164,8 +164,7 @@ def peak_signal_noise_ratio(image_true, image_test, *, data_range=None): image_true, image_test = _as_floats(image_true, image_test) err = mean_squared_error(image_true, image_test) - data_range = float(data_range) # prevent overflow for small integer types - return 10 * np.log10((data_range**2) / err) + return 20 * np.log10(data_range / err) def _pad_to(arr, shape): From b90376cbfbbfdf7d3a8f910b4fec03621b3cc2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <lagru@mailbox.org> Date: Wed, 8 May 2024 00:41:34 +0200 Subject: [PATCH 3/5] Catch and warn about pyamg not supporting NumPy 2 yet --- TODO.txt | 4 ++++ pyproject.toml | 1 + skimage/segmentation/random_walker_segmentation.py | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/TODO.txt b/TODO.txt index f8b35a6ea39..476f160dcd2 100644 --- a/TODO.txt +++ b/TODO.txt @@ -27,6 +27,10 @@ Other skimage/exposure/tests/test_exposure.py::test_rescale_nan_warning * Finalize ``skimage.future.manual_segmentation`` API, see https://github.com/scikit-image/scikit-image/issues/2624 +* Remove ``except AttributeError`` block in + ``skimage/segmentation/random_walker_segmentation.py`` as well as the warning filter + in ``pyproject.toml``, once pyamg supports NumPy 2 + (see https://github.com/pyamg/pyamg/issues/406). Post numpy 2 ------------ diff --git a/pyproject.toml b/pyproject.toml index 9e839b4b098..0ff6f176e9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -195,6 +195,7 @@ python_classes = ["Test*", "*Suite"] python_functions = ["time_*", "test_*", "peakmem_*"] filterwarnings = [ "error", + 'default:.*pyamg, which cannot \(yet\) be imported with NumPy >=2:RuntimeWarning' ] [tool.coverage.run] diff --git a/skimage/segmentation/random_walker_segmentation.py b/skimage/segmentation/random_walker_segmentation.py index c4dd2fe314b..d5c2cabcff7 100644 --- a/skimage/segmentation/random_walker_segmentation.py +++ b/skimage/segmentation/random_walker_segmentation.py @@ -43,6 +43,16 @@ def new_del(self): amg_loaded = True except ImportError: amg_loaded = False +except AttributeError as e: + if "`np.deprecate` was removed" not in e.args[0]: + raise e + warn( + "found optional dependency pyamg, which cannot (yet) be imported with " + "NumPy >=2 and will be treated as if not available", + RuntimeWarning, + ) + amg_loaded = False + from ..util import img_as_float From ad081e184464f74be2057060812d5ba745317b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <lagru@mailbox.org> Date: Wed, 8 May 2024 00:50:28 +0200 Subject: [PATCH 4/5] Revert "Update skimage/metrics/simple_metrics.py" This reverts commit bfbf88aad4fbd04b3657c682266d43aa0fe01ec4. --- skimage/metrics/simple_metrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skimage/metrics/simple_metrics.py b/skimage/metrics/simple_metrics.py index 6a255ed4211..7bb13acf189 100644 --- a/skimage/metrics/simple_metrics.py +++ b/skimage/metrics/simple_metrics.py @@ -164,7 +164,8 @@ def peak_signal_noise_ratio(image_true, image_test, *, data_range=None): image_true, image_test = _as_floats(image_true, image_test) err = mean_squared_error(image_true, image_test) - return 20 * np.log10(data_range / err) + data_range = float(data_range) # prevent overflow for small integer types + return 10 * np.log10((data_range**2) / err) def _pad_to(arr, shape): From 05d585cff4ccdef84db024fc1c99841b9fb57a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <lagru@mailbox.org> Date: Wed, 8 May 2024 10:14:40 +0200 Subject: [PATCH 5/5] Simplify except block a little bit --- .../random_walker_segmentation.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/skimage/segmentation/random_walker_segmentation.py b/skimage/segmentation/random_walker_segmentation.py index d5c2cabcff7..68d7c46cd1d 100644 --- a/skimage/segmentation/random_walker_segmentation.py +++ b/skimage/segmentation/random_walker_segmentation.py @@ -43,15 +43,16 @@ def new_del(self): amg_loaded = True except ImportError: amg_loaded = False -except AttributeError as e: - if "`np.deprecate` was removed" not in e.args[0]: - raise e - warn( - "found optional dependency pyamg, which cannot (yet) be imported with " - "NumPy >=2 and will be treated as if not available", - RuntimeWarning, - ) - amg_loaded = False +except AttributeError as error: + if "`np.deprecate` was removed" in error.args[0]: + warn( + "found optional dependency pyamg, which cannot (yet) be imported with " + "NumPy >=2 and will be treated as if not available", + RuntimeWarning, + ) + amg_loaded = False + else: + raise error from ..util import img_as_float
participants (1)
-
Source-Sync