From 39c456fd26c8057fc3d5fedc5575dbf3198e3188 Mon Sep 17 00:00:00 2001 From: Facundo Ferrin Date: Sun, 17 Feb 2019 03:43:05 +0100 Subject: [PATCH 1/3] [MRG] Fix #13152 - pypy failure in doctest of extract_patches_2d --- sklearn/feature_extraction/image.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sklearn/feature_extraction/image.py b/sklearn/feature_extraction/image.py index 7bb9e6a14effc..75703489e3085 100644 --- a/sklearn/feature_extraction/image.py +++ b/sklearn/feature_extraction/image.py @@ -341,7 +341,7 @@ def extract_patches_2d(image, patch_size, max_patches=None, random_state=None): >>> from sklearn.datasets import load_sample_images >>> from sklearn.feature_extraction import image >>> # Use the array data from the first image in this dataset: - >>> one_image = load_sample_images().images[0] + >>> one_image = load_sample_images().images[1] >>> print('Image shape: {}'.format(one_image.shape)) Image shape: (427, 640, 3) >>> patches = image.extract_patches_2d(one_image, (2, 2)) @@ -351,11 +351,13 @@ def extract_patches_2d(image, patch_size, max_patches=None, random_state=None): >>> print(patches[1]) # doctest: +NORMALIZE_WHITESPACE [[[174 201 231] [174 201 231]] + [[173 200 230] [173 200 230]]] >>> print(patches[800])# doctest: +NORMALIZE_WHITESPACE [[[187 214 243] [188 215 244]] + [[187 214 243] [188 215 244]]] """ From cc191c1b8994577decd9a95710c9582250089256 Mon Sep 17 00:00:00 2001 From: Facundo Ferrin Date: Sun, 17 Feb 2019 04:16:58 +0100 Subject: [PATCH 2/3] Fix #13152 - pypy failure in doctest of extract_patches_2d: Change selected image --- sklearn/feature_extraction/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/feature_extraction/image.py b/sklearn/feature_extraction/image.py index 75703489e3085..c9d3019073ced 100644 --- a/sklearn/feature_extraction/image.py +++ b/sklearn/feature_extraction/image.py @@ -341,7 +341,7 @@ def extract_patches_2d(image, patch_size, max_patches=None, random_state=None): >>> from sklearn.datasets import load_sample_images >>> from sklearn.feature_extraction import image >>> # Use the array data from the first image in this dataset: - >>> one_image = load_sample_images().images[1] + >>> one_image = load_sample_images().images[0] >>> print('Image shape: {}'.format(one_image.shape)) Image shape: (427, 640, 3) >>> patches = image.extract_patches_2d(one_image, (2, 2)) From a76e437db1af1384e08d8c4a2d0c9c3bddd02fb7 Mon Sep 17 00:00:00 2001 From: Facundo Ferrin Date: Sun, 17 Feb 2019 04:51:51 +0100 Subject: [PATCH 3/3] Fix #13152 - pypy failure in doctest of extract_patches_2d: Fix white line --- sklearn/feature_extraction/image.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sklearn/feature_extraction/image.py b/sklearn/feature_extraction/image.py index c9d3019073ced..7bb9e6a14effc 100644 --- a/sklearn/feature_extraction/image.py +++ b/sklearn/feature_extraction/image.py @@ -351,13 +351,11 @@ def extract_patches_2d(image, patch_size, max_patches=None, random_state=None): >>> print(patches[1]) # doctest: +NORMALIZE_WHITESPACE [[[174 201 231] [174 201 231]] - [[173 200 230] [173 200 230]]] >>> print(patches[800])# doctest: +NORMALIZE_WHITESPACE [[[187 214 243] [188 215 244]] - [[187 214 243] [188 215 244]]] """