8000 Comment tests that depend on PIL. · scikit-learn/scikit-learn@57b9fd3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 57b9fd3

Browse files
author
Fabian Pedregosa
committed
Comment tests that depend on PIL.
This is ugly, but I don't want to release with failing tests. Also, I can't use `doctest: +SKIP` because it fails when run through sklear.test().
1 parent c72711f commit 57b9fd3

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

sklearn/datasets/base.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -375,19 +375,19 @@ def load_sample_images():
375375
--------
376376
To load the data and visualize the images::
377377
378-
>>> from sklearn.datasets import load_sample_images
379-
>>> dataset = load_sample_images()
380-
>>> len(dataset.images)
381-
2
382-
>>> first_img_data = dataset.images[0]
383-
>>> first_img_data.shape # height, width, channels
384-
(427, 640, 3)
385-
>>> first_img_data.dtype
386-
dtype('uint8')
387-
>>> # import pylab as pl
388-
>>> # pl.gray()
389-
>>> # pl.matshow(dataset.images[0]) # Visualize the first image
390-
>>> # pl.show()
378+
# >>> from sklearn.datasets import load_sample_images
379+
# >>> dataset = load_sample_images()
380+
# >>> len(dataset.images)
381+
# 2
382+
# >>> first_img_data = dataset.images[0]
383+
# >>> first_img_data.shape
384+
# (427, 640, 3)
385+
# >>> first_img_data.dtype
386+
# dtype('uint8')
387+
# >>> import pylab as pl
388+
# >>> pl.gray()
389+
# >>> pl.matshow(dataset.images[0]) # Visualize the first image
390+
# >>> pl.show()
391391
"""
392392
# Try to import imread from scipy. We do this lazily here to prevent
393393
# this module from depending on PIL.
@@ -415,18 +415,17 @@ def load_sample_images():
415415
def load_sample_image(image_name):
416416
"""Load the numpy array of a single sample image
417417
418-
>>> from sklearn.datasets import load_sample_image
419-
>>> china = load_sample_image('china.jpg')
420-
>>> china.dtype
421-
dtype('uint8')
422-
>>> china.shape
423-
(427, 640, 3)
424-
425-
>>> flower = load_sample_image('flower.jpg')
426-
>>> flower.dtype
427-
dtype('uint8')
428-
>>> flower.shape
429-
(427, 640, 3)
418+
# >>> from sklearn.datasets import load_sample_image
419+
# >>> china = load_sample_image('china.jpg')
420+
# >>> china.dtype
421+
# dtype('uint8')
422+
# >>> china.shape
423+
# (427, 640, 3)
424+
# >>> flower = load_sample_image('flower.jpg') # doctest: +SKIP
425+
# >>> flower.dtype
426+
# dtype('uint8')
427+
# >>> flower.shape
4DB8
428+
# (427, 640, 3)
430429
"""
431430
images = load_sample_images()
432431
index = None

0 commit comments

Comments
 (0)
0