Current interpolation test fails on i386
When building the Kwant 1.3 Debian packages I noticed that a test in test_plotter.py fails on i386. Looking closer into it, when using Kwant 1.3 with the following patch applied
diff --git a/kwant/tests/test_plotter.py b/kwant/tests/test_plotter.py
index fa8cd5a..ffdeb7a 100644
--- a/kwant/tests/test_plotter.py
+++ b/kwant/tests/test_plotter.py
@@ -359,6 +359,7 @@ def test_current_interpolation():
# slice field perpendicular to a cut along the y axis
y_axis = (np.argmin(np.abs(x)), slice(None), 0)
J_interp = scipy.integrate.simps(j0[y_axis], y)
+ print(J_interp, J_exact)
data.append((n, abs(J_interp - J_exact)))
# 3rd value returned from 'linregress' is 'rvalue'
assert scipy.stats.linregress(np.log(data))[2] < -0.8
and running it with
python3 -m pytest -s kwant/tests/test_plotter.py::test_current_interpolation
I get on amd64:
0.924617975504 0.92962061213
0.928435296078 0.92962061213
0.929223551988 0.92962061213
0.929628706328 0.92962061213
0.929587768519 0.92962061213
0.928124036775 0.92962061213
0.928435296078 0.92962061213
0.929485068904 0.92962061213
0.929642421293 0.92962061213
0.929608826211 0.92962061213
0.928124036775 0.92962061213
0.928435296078 0.92962061213
0.929485068904 0.92962061213
0.929642421294 0.92962061213
0.929608826211 0.92962061213
0.926914623949 0.92962061213
0.928598545587 0.92962061213
0.929525358961 0.92962061213
0.92962655722 0.92962061213
0.929621610233 0.92962061213
0.929219062828 0.92962061213
0.930261253098 0.92962061213
0.929750469837 0.92962061213
0.929607238701 0.92962061213
0.929624789733 0.92962061213
but on i386 I get:
0.941197483197 0.946101173437
0.944894843787 0.946101173437
0.945711854443 0.946101173437
0.946101808425 0.946101173437
0.946068965764 0.946101173437
Then, it stops due to
# 3rd value returned from 'linregress' is 'rvalue'
> assert scipy.stats.linregress(np.log(data))[2] < -0.8
E assert -0.77238843185559236 < -0.8
kwant/tests/test_plotter.py:365: AssertionError
This is rather disquieting. I'm in the process of looking into this. @jbweston, any ideas?