Repository navigation
Closed
Description
Description
I am trying to get the Debian skimage package working with the new numpy version. Apart from #3551 (where I backported #3556 for a fix), I get the following errors:
__________________________________ test_uint8 __________________________________
def test_uint8():
plt.figure()
with expected_warnings(["tight_layout : falling back to Agg|\A\Z",
"CObject type is marked|\A\Z"]):
> ax_im = io.imshow(im8)
skimage/io/tests/test_mpl_imshow.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python2.7/contextlib.py:24: in __exit__
self.gen.next()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
matching = ['tight_layout : falling back to Agg|\\A\\Z', 'CObject type is marked|\\A\\Z']
@contextmanager
def expected_warnings(matching):
"""[...]"""
if isinstance(matching, str):
raise ValueError('``matching`` should be a list of strings and not '
'a string itself.')
with all_warnings() as w:
# enter context
yield w
# exited user context, check the recorded warnings
# Allow users to provide None
while None in matching:
matching.remove(None)
remaining = [m for m in matching if '\A\Z' not in m.split('|')]
for warn in w:
found = False
for match in matching:
if re.search(match, str(warn.message)) is not None:
found = True
if match in remaining:
remaining.remove(match)
if not found:
> raise ValueError('Unexpected warning: %s' % str(warn.message))
E ValueError: Unexpected warning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead
skimage/_shared/_warnings.py:127: ValueError
which repeats a number of times for different tests. It looks that the dependency warning is ignored here; however I don't find np.asscalar() used anywhere in the sources. And the stacktrace does not enlighten me where it could be generated.
These failures however currently prevent us from creating a bugfixed package.
Way to reproduce
- Code example -- se above
- Relevant images (if any) -- no
- Operating system and version -- Debian unstable (sid)
- Python version -- 2.7.15, numpy 1.16.0~rc1
- scikit-image version (run
skimage.__version__) 0.14.1
I'll attach the full build log.
skimage_0.14.1-3_amd64.build.gz
Metadata
Metadata
Assignees
Labels
No labels
Activity
hmaarrfk commentedon Dec 30, 2018
Thanks for looking into it. and the really detailed issue.
Unfortunately, I can't seem to recreate the issue:
pip list
Are you using any other
--prepackages?I think this failure is pretty innocent. I wouldn't let it stop you from building the package.
Things you can do:
skimage/io/tests/tests_mpl_imshow.pyprior to testing (easy)Maybe for your package you can simply deselect the testThese instructions didn't work for me!!!!
https://docs.pytest.org/en/latest/example/pythoncollection.html#ignore-paths-during-test-collection
https://docs.pytest.org/en/latest/example/pythoncollection.html#deselect-tests-during-test-collection
hmaarrfk commentedon Dec 30, 2018
Here is the patch that would make your tests pass:
https://github.com/scikit-image/scikit-image/commit/33960948f77ac5c208e917e84f8ee01adfa5b095.patch
Also, I had trouble with dask 1.0.0
but maybe you guys patched it?
what is dfsg??
olebole commentedon Dec 30, 2018
For the dask problem, see #3633. "+dfsg" means that some source that is not compatible to the Debian Free Source Guidelines was removed. Specifically these are the files
docs/source/_static/profile.htmlanddocs/source/_static/stacked_profile.html; so probably nothing important. There were other patches applied to dask, but they also seem to be safe.olebole commentedon Dec 30, 2018
The patch 3396094 still needs the
|\A\Z, since the warnings do not appear on 3.7.hmaarrfk commentedon Dec 30, 2018
my dask issue was more with collecting the tests. Something a ufuncs.
Thanks for catching the fact that the warning needed to be optional in certain locations. Here is the fixed up patch
https://github.com/scikit-image/scikit-image/commit/2b8237e326e2f354d7178769b892e6cbad2c94fe.patch
hmaarrfk commentedon Dec 30, 2018
See this is the error I'm getting:
https://ci.appveyor.com/project/scikit-image/scikit-image/builds/21295810/job/smaws2qm1x2eg4bo#L3178
olebole commentedon Dec 30, 2018
I can confirm that 2b8237e works for this issue. Thank you!
soupault commentedon Jan 2, 2019
Closed via #3632.