nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

Merge pull request #249674 from natsukium/skimage/update

python310Packages.scikit-image: 0.19.3 -> 0.21.0

authored by

OTABI Tomoya and committed by
GitHub
2275ce45 2a242982

+100 -38
-17
pkgs/development/python-modules/scikit-image/add-testing-data.patch
··· 1 - diff --git a/skimage/data/setup.py b/skimage/data/setup.py 2 - index 528e9c284ce..ba0e155559c 100644 3 - --- a/skimage/data/setup.py 4 - +++ b/skimage/data/setup.py 5 - @@ -11,7 +11,11 @@ def configuration(parent_package='', top_path=None): 6 - # further notice. 7 - # Testing data and additional datasets should only 8 - # be made available via pooch 9 - - config.add_data_files(*legacy_datasets) 10 - + # Nix patch: add ALL images to facilitate testing of a fully-built package 11 - + from pathlib import Path 12 - + config.add_data_files( 13 - + *(path.name for path in Path(__file__).parent.glob("*") if path.suffix != ".py") 14 - + ) 15 - # It seems hard to create a consistent hash for README.txt since 16 - # the line endings keep getting converted 17 - config.add_data_files('README.txt')
+70 -21
pkgs/development/python-modules/scikit-image/default.nix
··· 3 3 , fetchFromGitHub 4 4 , buildPythonPackage 5 5 , python 6 - , cython 7 - , pythran 8 - , numpy 9 - , scipy 10 - , matplotlib 11 - , networkx 12 - , six 13 - , pillow 14 - , pywavelets 15 - , dask 6 + , pythonOlder 7 + , astropy 16 8 , cloudpickle 9 + , cython 10 + , dask 17 11 , imageio 18 - , tifffile 12 + , lazy-loader 13 + , matplotlib 14 + , meson-python 15 + , networkx 16 + , numpy 17 + , packaging 18 + , pillow 19 + , pooch 20 + , pyamg 19 21 , pytestCheckHook 22 + , pythran 23 + , pywavelets 24 + , scikit-learn 25 + , scipy 26 + , setuptools 27 + , simpleitk 28 + , six 29 + , tifffile 30 + , wheel 20 31 }: 21 32 22 33 let 23 34 installedPackageRoot = "${builtins.placeholder "out"}/${python.sitePackages}"; 24 35 self = buildPythonPackage rec { 25 36 pname = "scikit-image"; 26 - version = "0.19.3"; 37 + version = "0.21.0"; 38 + format = "pyproject"; 39 + 40 + disabled = pythonOlder "3.8"; 27 41 28 42 src = fetchFromGitHub { 29 - owner = pname; 30 - repo = pname; 43 + owner = "scikit-image"; 44 + repo = "scikit-image"; 31 45 rev = "v${version}"; 32 - hash = "sha256-zvXgZdvYycFbbMsBFSqMDzLanEtF9+JuVSQ3AM8/LQk="; 46 + hash = "sha256-WJ2WNlcFCEtPr+bV/af6MoBBhbXDpOBEsJu4FmudoIo="; 33 47 }; 34 48 35 - patches = [ ./add-testing-data.patch ]; 49 + patches = [ 50 + # https://github.com/scikit-image/scikit-image/pull/7052 51 + # prepare a patch file because the commit contains additional changes 52 + ./suppress-deprecation-warning.patch 53 + ]; 36 54 37 - nativeBuildInputs = [ cython pythran ]; 55 + postPatch = '' 56 + patchShebangs skimage/_build_utils/{version,cythoner}.py 57 + ''; 58 + 59 + nativeBuildInputs = [ 60 + cython 61 + meson-python 62 + numpy 63 + packaging 64 + pythran 65 + setuptools 66 + wheel 67 + ]; 38 68 39 69 propagatedBuildInputs = [ 40 - cloudpickle 41 - dask 42 70 imageio 71 + lazy-loader 43 72 matplotlib 44 73 networkx 45 74 numpy 75 + packaging 46 76 pillow 47 77 pywavelets 48 78 scipy 49 - six 50 79 tifffile 51 80 ]; 81 + 82 + passthru.optional-dependencies = { 83 + data = [ 84 + pooch 85 + ]; 86 + optional = [ 87 + astropy 88 + cloudpickle 89 + dask 90 + matplotlib 91 + pooch 92 + pyamg 93 + scikit-learn 94 + simpleitk 95 + ] ++ dask.optional-dependencies.array; 96 + }; 52 97 53 98 # test suite is very cpu intensive, move to passthru.tests 54 99 doCheck = false; ··· 123 78 "skimage/feature/tests/test_util.py::test_plot_matches" 124 79 "skimage/filters/tests/test_thresholding.py::TestSimpleImage::test_try_all_threshold" 125 80 "skimage/io/tests/test_mpl_imshow.py::" 81 + ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ 82 + # https://github.com/scikit-image/scikit-image/issues/7104 83 + "skimage/measure/tests/test_fit.py" 84 + "skimage/measure/tests/test_moments.py" 126 85 ]); 127 86 128 87 # Check cythonized modules ··· 137 88 "skimage.feature" 138 89 "skimage.restoration" 139 90 "skimage.filters" 140 - "skimage.future.graph" 141 91 "skimage.graph" 142 92 "skimage.io" 143 93 "skimage.measure" ··· 153 105 meta = { 154 106 description = "Image processing routines for SciPy"; 155 107 homepage = "https://scikit-image.org"; 108 + changelog = "https://github.com/scikit-image/scikit-image/releases/tag/${src.rev}"; 156 109 license = lib.licenses.bsd3; 157 110 maintainers = with lib.maintainers; [ yl3dy ]; 158 111 };
+30
pkgs/development/python-modules/scikit-image/suppress-deprecation-warning.patch
··· 1 + diff --git a/skimage/exposure/tests/test_exposure.py b/skimage/exposure/tests/test_exposure.py 2 + index ed8dd6bc8..8ec7d13bf 100644 3 + --- a/skimage/exposure/tests/test_exposure.py 4 + +++ b/skimage/exposure/tests/test_exposure.py 5 + @@ -368,19 +368,16 @@ def test_rescale_nan_warning(in_range, out_range): 6 + ) 7 + 8 + # 2019/11/10 Passing NaN to np.clip raises a DeprecationWarning for 9 + - # versions above 1.17 10 + - # TODO: Remove once NumPy removes this DeprecationWarning 11 + + # versions above 1.17, "|\A\Z" marks as optional warning 12 + + # TODO: Remove once NumPy 1.25.0 is minimal dependency 13 + numpy_warning_1_17_plus = ( 14 + - "Passing `np.nan` to mean no clipping in np.clip" 15 + + "|\\A\\ZPassing `np.nan` to mean no clipping in np.clip" 16 + ) 17 + 18 + - if in_range == "image": 19 + - exp_warn = [msg, numpy_warning_1_17_plus] 20 + - else: 21 + - exp_warn = [msg] 22 + + with expected_warnings([msg, numpy_warning_1_17_plus]): 23 + + result = exposure.rescale_intensity(image, in_range, out_range) 24 + 25 + - with expected_warnings(exp_warn): 26 + - exposure.rescale_intensity(image, in_range, out_range) 27 + + assert np.all(np.isnan(result)) 28 + 29 + 30 + @pytest.mark.parametrize(