{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1048","labels_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1048/labels{/name}","comments_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1048/comments","events_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1048/events","html_url":"https://github.com/scikit-image/scikit-image/issues/1048","id":37107120,"number":1048,"title":"System-dependent doctest failures","user":{"login":"jni","id":492549,"avatar_url":"https://avatars.githubusercontent.com/u/492549?v=3","gravatar_id":"","url":"https://api.github.com/users/jni","html_url":"https://github.com/jni","followers_url":"https://api.github.com/users/jni/followers","following_url":"https://api.github.com/users/jni/following{/other_user}","gists_url":"https://api.github.com/users/jni/gists{/gist_id}","starred_url":"https://api.github.com/users/jni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jni/subscriptions","organizations_url":"https://api.github.com/users/jni/orgs","repos_url":"https://api.github.com/users/jni/repos","events_url":"https://api.github.com/users/jni/events{/privacy}","received_events_url":"https://api.github.com/users/jni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-07-03T18:01:12Z","updated_at":"2015-12-11T22:01:35Z","closed_at":null,"body":"I originally reported these on the [mailing list](https://groups.google.com/forum/#!topic/scikit-image/v8xjq7_2xq4), adding them here for tracking. The solution will in part depend on explicitly setting the print precision in numpy for doctests.\r\n\r\nRunning `skimage.doctest()` on my system (OSX 10.9, Anaconda) results in failures, apparently due to precision issues (see below).\r\n\r\n\r\n```\r\n........................................F.F...................................F./Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py:4: skimage_deprecation: Call to deprecated function ``label``. Use ``skimage.measure.label`` instead.\r\n  return _label(input, neighbors, background, return_num)\r\n..F.......................................................\r\n======================================================================\r\nFAIL: Doctest: skimage.feature.texture.greycoprops\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 2226, in runTest\r\n    raise self.failureException(self.format_failure(new.getvalue()))\r\nAssertionError: Failed doctest test for skimage.feature.texture.greycoprops\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/feature/texture.py\", line 125, in greycoprops\r\n\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/feature/texture.py\", line 176, in skimage.feature.texture.greycoprops\r\nFailed example:\r\n    contrast\r\nExpected:\r\n    array([[ 0.58333333,  1.        ],\r\n           [ 1.25      ,  2.75      ]])\r\nGot:\r\n    array([[ 0.5833333333,  1.          ],\r\n           [ 1.25        ,  2.75        ]])\r\n\r\n\r\n======================================================================\r\nFAIL: Doctest: skimage.filter._gaussian.gaussian_filter\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 2226, in runTest\r\n    raise self.failureException(self.format_failure(new.getvalue()))\r\nAssertionError: Failed doctest test for skimage.filter._gaussian.gaussian_filter\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/filter/_gaussian.py\", line 13, in gaussian_filter\r\n\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/filter/_gaussian.py\", line 73, in skimage.filter._gaussian.gaussian_filter\r\nFailed example:\r\n    gaussian_filter(a, sigma=0.4)  # mild smoothing\r\nExpected:\r\n    array([[ 0.00163116,  0.03712502,  0.00163116],\r\n           [ 0.03712502,  0.84496158,  0.03712502],\r\n           [ 0.00163116,  0.03712502,  0.00163116]])\r\nGot:\r\n    array([[ 0.0016311596,  0.0371250207,  0.0016311596],\r\n           [ 0.0371250207,  0.8449615765,  0.0371250207],\r\n           [ 0.0016311596,  0.0371250207,  0.0016311596]])\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/filter/_gaussian.py\", line 77, in skimage.filter._gaussian.gaussian_filter\r\nFailed example:\r\n    gaussian_filter(a, sigma=1)  # more smooting\r\nExpected:\r\n    array([[ 0.05855018,  0.09653293,  0.05855018],\r\n           [ 0.09653293,  0.15915589,  0.09653293],\r\n           [ 0.05855018,  0.09653293,  0.05855018]])\r\nGot:\r\n    array([[ 0.0585501805,  0.096532928 ,  0.0585501805],\r\n           [ 0.096532928 ,  0.1591558917,  0.096532928 ],\r\n           [ 0.0585501805,  0.096532928 ,  0.0585501805]])\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/filter/_gaussian.py\", line 82, in skimage.filter._gaussian.gaussian_filter\r\nFailed example:\r\n    gaussian_filter(a, sigma=1, mode='reflect')\r\nExpected:\r\n    array([[ 0.08767308,  0.12075024,  0.08767308],\r\n           [ 0.12075024,  0.16630671,  0.12075024],\r\n           [ 0.08767308,  0.12075024,  0.08767308]])\r\nGot:\r\n    array([[ 0.0876730803,  0.1207502431,  0.0876730803],\r\n           [ 0.1207502431,  0.1663067063,  0.1207502431],\r\n           [ 0.0876730803,  0.1207502431,  0.0876730803]])\r\n\r\n\r\n======================================================================\r\nFAIL: Doctest: skimage.measure._label.label\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 2226, in runTest\r\n    raise self.failureException(self.format_failure(new.getvalue()))\r\nAssertionError: Failed doctest test for skimage.measure._label.label\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line unknown line number, in label\r\n\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line ?, in skimage.measure._label.label\r\nFailed example:\r\n    x = np.eye(3).astype(int)\r\nException raised:\r\n    Traceback (most recent call last):\r\n      File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 1315, in __run\r\n        compileflags, 1) in test.globs\r\n      File \"<doctest skimage.measure._label.label[0]>\", line 1, in <module>\r\n        x = np.eye(3).astype(int)\r\n    NameError: name 'np' is not defined\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line ?, in skimage.measure._label.label\r\nFailed example:\r\n    print(x)\r\nException raised:\r\n    Traceback (most recent call last):\r\n      File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 1315, in __run\r\n        compileflags, 1) in test.globs\r\n      File \"<doctest skimage.measure._label.label[1]>\", line 1, in <module>\r\n        print(x)\r\n    NameError: name 'x' is not defined\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line ?, in skimage.measure._label.label\r\nFailed example:\r\n    print(m.label(x, neighbors=4))\r\nException raised:\r\n    Traceback (most recent call last):\r\n      File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 1315, in __run\r\n        compileflags, 1) in test.globs\r\n      File \"<doctest skimage.measure._label.label[2]>\", line 1, in <module>\r\n        print(m.label(x, neighbors=4))\r\n    NameError: name 'm' is not defined\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line ?, in skimage.measure._label.label\r\nFailed example:\r\n    print(m.label(x, neighbors=8))\r\nException raised:\r\n    Traceback (most recent call last):\r\n      File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 1315, in __run\r\n        compileflags, 1) in test.globs\r\n      File \"<doctest skimage.measure._label.label[3]>\", line 1, in <module>\r\n        print(m.label(x, neighbors=8))\r\n    NameError: name 'm' is not defined\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line ?, in skimage.measure._label.label\r\nFailed example:\r\n    x = np.array([[1, 0, 0],\r\n                  [1, 1, 5],\r\n                  [0, 0, 0]])\r\nException raised:\r\n    Traceback (most recent call last):\r\n      File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 1315, in __run\r\n        compileflags, 1) in test.globs\r\n      File \"<doctest skimage.measure._label.label[4]>\", line 1, in <module>\r\n        x = np.array([[1, 0, 0],\r\n    NameError: name 'np' is not defined\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/_label.py\", line ?, in skimage.measure._label.label\r\nFailed example:\r\n    print(m.label(x, background=0))\r\nException raised:\r\n    Traceback (most recent call last):\r\n      File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 1315, in __run\r\n        compileflags, 1) in test.globs\r\n      File \"<doctest skimage.measure._label.label[5]>\", line 1, in <module>\r\n        print(m.label(x, background=0))\r\n    NameError: name 'm' is not defined\r\n\r\n\r\n======================================================================\r\nFAIL: Doctest: skimage.measure.fit.ransac\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/doctest.py\", line 2226, in runTest\r\n    raise self.failureException(self.format_failure(new.getvalue()))\r\nAssertionError: Failed doctest test for skimage.measure.fit.ransac\r\n  File \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/fit.py\", line 470, in ransac\r\n\r\n----------------------------------------------------------------------\r\nFile \"/Users/nuneziglesiasj/anaconda/lib/python2.7/site-packages/skimage/measure/fit.py\", line 576, in skimage.measure.fit.ransac\r\nFailed example:\r\n    ransac_model.params\r\nExpected:\r\n    array([ 20.12762373,  29.73563063,   4.81499637,  10.4743584 ,   0.05217117])\r\nGot:\r\n    array([ 20.1276237259,  29.7356306313,   4.8149963715,  10.474358404 ,\r\n             0.0521711691])\r\n```"},"comment":{"url":"https://api.github.com/repos/scikit-image/scikit-image/issues/comments/164061554","html_url":"https://github.com/scikit-image/scikit-image/issues/1048#issuecomment-164061554","issue_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1048","id":164061554,"user":{"login":"soupault","id":1315589,"avatar_url":"https://avatars.githubusercontent.com/u/1315589?v=3","gravatar_id":"","url":"https://api.github.com/users/soupault","html_url":"https://github.com/soupault","followers_url":"https://api.github.com/users/soupault/followers","following_url":"https://api.github.com/users/soupault/following{/other_user}","gists_url":"https://api.github.com/users/soupault/gists{/gist_id}","starred_url":"https://api.github.com/users/soupault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soupault/subscriptions","organizations_url":"https://api.github.com/users/soupault/orgs","repos_url":"https://api.github.com/users/soupault/repos","events_url":"https://api.github.com/users/soupault/events{/privacy}","received_events_url":"https://api.github.com/users/soupault/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T22:01:35Z","updated_at":"2015-12-11T22:01:35Z","body":"@jni Any updates on this?"}}