netsiphd/netrd

ValueError ufunc incompatibility in tests

sdmccabe opened this issue · 6 comments

________________ ERROR collecting tests/test_reconstruction.py _________________

test_reconstruction.py:10: in <module>

    from netrd import reconstruction

../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/netrd/__init__.py:12: in <module>

    from . import distance

../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/netrd/distance/__init__.py:23: in <module>

    from .nbd import NonBacktrackingSpectral

../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/netrd/distance/nbd.py:13: in <module>

    from ot import emd2

../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/ot/__init__.py:54: in <module>

    from . import lp

../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/ot/lp/__init__.py:21: in <module>

    from .emd_wrap import emd_c, check_result, emd_1d_sorted

__init__.pxd:918: in init ot.lp.emd_wrap

    ???

E   ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!

=========================== 3 error in 1.10 seconds ============================

The command "pytest" exited with 2.

The relevant issue is here. The simplest fix would be to bump numpy to 1.16: I suspect this might also be the time to fix the == Cython dependency.

How bad is it of us to bump to 1.16? Right now we require 1.10.

1.16 was released around January this year, so it's a big jump.

Because there's some suggestion that it might a Cython-Numpy interaction, I'm going to PR a change to requirements switching the Cython dependency to >= and see if that fixes it in Travis unfortunately I haven't replicated the issue locally[1].

ok then let's not bump numpy

Tweaking the Cython requirement didn't fix it.

I was mistaken before; it's not the black environments - that's 3.6 and 3.7 Linux. This is failing on 3.5 and 3.7 Linux. Comparing the (successful) 3.6 build to the (failing) 3.7 build, you can see that 3.6 is installing Numpy 1.15.4 and 3.7 is installing 1.16.2.

The problem seems to be: we're requiring Cython >0.29, which requires numpy > 1.16. So if we keep that Cython requirement we should just bump numpy.

Resolved by #252.