Skip to content

Commit 1ef8025

Browse files
committed
test_doctest: Remove check for numpy version
Fix docstrings where appropriate.
1 parent 89154c4 commit 1ef8025

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

Orange/evaluation/scoring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
--------
66
>>> import Orange
77
>>> data = Orange.data.Table('iris')
8-
>>> learner = Orange.classification.LogisticRegressionLearner()
8+
>>> learner = Orange.classification.LogisticRegressionLearner(solver="liblinear")
99
>>> results = Orange.evaluation.TestOnTrainingData(data, [learner])
1010
1111
"""
@@ -293,7 +293,7 @@ class LogLoss(ClassificationScore):
293293
Examples
294294
--------
295295
>>> Orange.evaluation.LogLoss(results)
296-
array([ 0.3...])
296+
array([0.3...])
297297
298298
"""
299299
__wraps__ = skl_metrics.log_loss

Orange/statistics/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ def bincount(x, weights=None, max_val=None, minlength=0):
116116
values as well, even if they do not appear in the data. However, this will
117117
not truncate the bincount if values larger than `max_count` are found.
118118
>>> bincount([0, 0, 1, 1, 2], max_val=4)
119-
(array([ 2., 2., 1., 0., 0.]), 0.0)
119+
(array([2., 2., 1., 0., 0.]), 0.0)
120120
>>> bincount([0, 1, 2, 3, 4], max_val=2)
121-
(array([ 1., 1., 1., 1., 1.]), 0.0)
121+
(array([1., 1., 1., 1., 1.]), 0.0)
122122
123123
"""
124124
# Store the original matrix before any manipulation to check for sparse

Orange/tests/test_doctest.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import sys
22
import os
3-
import unittest
43
from doctest import DocTestSuite, ELLIPSIS, NORMALIZE_WHITESPACE
54

6-
import pkg_resources
7-
import numpy
8-
95
SKIP_DIRS = (
106
# Skip modules which import and initialize stuff that require QApplication
117
'Orange/widgets',
@@ -55,24 +51,12 @@ def clear(self):
5551
def suite(package):
5652
"""Assemble test suite for doctests in path (recursively)"""
5753
from importlib import import_module
58-
# numpy 1.14 changed array str/repr (NORMALIZE_WHITESPACE does not
59-
# handle this). When 1.15 is released update all docstrings and skip the
60-
# tests for < 1.14.
61-
npversion = pkg_resources.parse_version(numpy.__version__)
62-
if npversion >= pkg_resources.parse_version("1.14"):
63-
def setUp(test):
64-
raise unittest.SkipTest("Skip doctest on numpy >= 1.14.0")
65-
else:
66-
def setUp(test):
67-
pass
68-
6954
for module in find_modules(package.__file__):
7055
try:
7156
module = import_module(module)
7257
yield DocTestSuite(module,
7358
globs=Context(module.__dict__.copy()),
74-
optionflags=ELLIPSIS | NORMALIZE_WHITESPACE,
75-
setUp=setUp)
59+
optionflags=ELLIPSIS | NORMALIZE_WHITESPACE)
7660
except ValueError:
7761
pass # No doctests in module
7862
except ImportError:

0 commit comments

Comments
 (0)