From 9a8e3614d40f64f9374c712df3957b69c666bb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Wiik=20=C3=85nes?= Date: Fri, 7 Aug 2020 17:04:38 +0200 Subject: [PATCH] Allow scikit-image >= 0.16, fix related adaptive histogram test (#196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Allow skimage >= 0.16 in setup.py, fix adaptive histogram test Signed-off-by: Håkon Wiik Ånes * Add change to changelog Signed-off-by: Håkon Wiik Ånes --- doc/changelog.rst | 4 +++- kikuchipy/pattern/tests/test_chunk.py | 9 ++++++++- setup.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 1ed9d4ff..27b40080 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -20,7 +20,9 @@ Contributors Changed ------- -- Removed `language_version` in `pre-commit` config file. +- Allow scikit-image >= 0.16. + (`#196 `_) +- Removed language_version in pre-commit config file. (`#195 `_) 0.2.2 (2020-05-24) diff --git a/kikuchipy/pattern/tests/test_chunk.py b/kikuchipy/pattern/tests/test_chunk.py index ebbc5136..e3c3c32e 100644 --- a/kikuchipy/pattern/tests/test_chunk.py +++ b/kikuchipy/pattern/tests/test_chunk.py @@ -20,6 +20,7 @@ import numpy as np import pytest from scipy.ndimage import convolve, gaussian_filter +from skimage import __version__ as skimage_version from skimage.util.dtype import dtype_range from kikuchipy.filters.fft_barnes import _fft_filter @@ -76,9 +77,15 @@ DYN_CORR_UINT8_SPATIAL_STD2_OMAX250 = np.array( [[167, 210, 177], [250, 217, 184], [217, 31, 0]], dtype=np.uint8, ) -ADAPT_EQ_UINT8 = np.array( +ADAPT_EQ_UINT8_SKIMAGE16 = np.array( [[127, 223, 127], [255, 223, 31], [223, 31, 0]], dtype=np.uint8 ) +ADAPT_EQ_UINT8_SKIMAGE17 = np.array( + [[92, 215, 92], [255, 215, 92], [215, 26, 0]], dtype=np.uint8 +) +ADAPT_EQ_UINT8 = ADAPT_EQ_UINT8_SKIMAGE16 +if skimage_version[2:4] == str(17): + ADAPT_EQ_UINT8 = ADAPT_EQ_UINT8_SKIMAGE17 class TestRescaleIntensityChunk: diff --git a/setup.py b/setup.py index 700ec69d..91676fea 100644 --- a/setup.py +++ b/setup.py @@ -119,7 +119,7 @@ "matplotlib >= 3.2", "numpy >= 1.18", "numba >= 0.48", - "scikit-image >= 0.16, < 0.17", + "scikit-image >= 0.16", "scikit-learn", "scipy", ],