Closed riastradh-probcomp closed 8 years ago
% pip freeze Babel==2.1.1 Cython==0.23.4 Jinja2==2.8 MarkupSafe==0.23 Pillow==3.0.0 Pygments==2.0.2 Sphinx==1.3.1 alabaster==0.7.6 argparse==1.2.1 backports.ssl-match-hostname==3.4.0.2 bayeslite==0.1.3rc1 bdbcontrib==0.1.3rc2 certifi==2015.9.6.2 crosscat==0.1.38 decorator==4.0.4 docutils==0.12 funcsigs==0.4 functools32==3.2.3-2 ipykernel==4.1.1 ipython==4.0.0 ipython-genutils==0.1.0 jsonschema==2.5.1 jupyter-client==4.1.1 jupyter-core==4.0.6 markdown2==2.3.0 matplotlib==1.4.3 mistune==0.7.1 mock==1.3.0 nbconvert==4.0.0 nbformat==4.0.1 nose==1.3.7 notebook==4.0.6 numpy==1.10.1 numpydoc==0.5 pandas==0.17.0 path.py==8.1.2 pbr==1.8.1 pexpect==4.0.1 pickleshare==0.5 ptyprocess==0.5 py==1.4.30 pyparsing==2.0.5 pytest==2.8.2 python-dateutil==2.4.2 pytz==2015.7 pyzmq==14.7.0 requests==2.8.1 scikit-learn==0.16.1 scipy==0.16.1 seaborn==0.6.0 simplegeneric==0.8.1 six==1.10.0 sklearn==0.0 sklearn-pandas==0.0.10 snowballstemmer==1.2.0 sphinx-rtd-theme==0.1.9 terminado==0.5 tornado==4.2.1 traitlets==4.0.0 wsgiref==0.1.2
http://stackoverflow.com/questions/16015864/python-valueerror-operands-could-not-be-broadcast-together-with-shapes indicates that this is probably an error in our code that matplotlib 1.4.3 was just silently dealing with, while 1.5.0 actually checks and crashes.
$ ./check.sh --pdb
E ValueError: operands could not be broadcast together with shapes (14,) (15,) (14,)
../../../pc/27/lib/python2.7/site-packages/numpy/lib/function_base.py:249: ValueError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /Users/probcomp/pc/27/lib/python2.7/site-packages/numpy/lib/function_base.py(249)histogram()
-> n += np.bincount(indices, weights=tmp_w, minlength=bins).astype(ntype)
(Pdb) bc = np.bincount(indices, weights=tmp_w, minlength=bins).astype(ntype)
(Pdb) p bc
array([163, 11, 8, 7, 8, 2, 0, 0, 3, 1, 1, 0, 1,
0, 2])
(Pdb) p n
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
(Pdb) p len(n)
14
(Pdb) p len(bc)
15
So that's the problem. They have mismatched sizes. That's what the error complains about.
n was initialized as np.zeros(bins) and this is the first time through the loop.
(Pdb) p i
0
(Pdb) p bins
14.387494569938159
(Pdb) p len(np.zeros(bins))
14
But np.bincount returns something one longer than its input length: http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.bincount.html
So this is a coding error in numpy.histogram. What versions of numpy are we using? Jenkins is using 1.8.2, I'm using 1.10.1. Is this a regression in numpy? 1.8.2 uses linspace to make the right set of bins itself, so yes, perhaps. Interesting.
Leaving it here for tonight.
packaging/jenkins now codifies a build environment that we should be using on our laptops too, and that we should recommend to our users. Jenkins uses that build environment, and in that environment, this is no longer an issue.
https://github.com/probcomp/packaging/commit/c851d0ecaa52e250ff6ac398dd029b4fea7bafd1