Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empirical p-value error, maybe caused by numpy 1.10 #369

Closed
matthew-brett opened this issue Oct 11, 2015 · 0 comments · Fixed by #372
Closed

empirical p-value error, maybe caused by numpy 1.10 #369

matthew-brett opened this issue Oct 11, 2015 · 0 comments · Fixed by #372

Comments

@matthew-brett
Copy link
Member

This just came up on travis:

======================================================================
ERROR: nipy.algorithms.statistics.tests.test_empirical_pvalue.test_efdr
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matthew-brett/nipy/venv/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matthew-brett/nipy/venv/lib/python3.5/site-packages/nipy/algorithms/statistics/tests/test_empirical_pvalue.py", line 31, in test_efdr
    np.testing.assert_array_less(efdr.fdr(3.0), 0.2)
  File "/home/travis/build/matthew-brett/nipy/venv/lib/python3.5/site-packages/nipy/algorithms/statistics/empirical_pvalue.py", line 310, in fdr
    self.fdrcurve()
  File "/home/travis/build/matthew-brett/nipy/venv/lib/python3.5/site-packages/nipy/algorithms/statistics/empirical_pvalue.py", line 234, in fdrcurve
    self.learn()
  File "/home/travis/build/matthew-brett/nipy/venv/lib/python3.5/site-packages/nipy/algorithms/statistics/empirical_pvalue.py", line 206, in learn
    hist, ledge = np.histogram(x, bins=bins)
  File "/home/travis/build/matthew-brett/nipy/venv/lib/python3.5/site-packages/numpy/lib/function_base.py", line 249, in histogram
    n += np.bincount(indices, weights=tmp_w, minlength=bins).astype(ntype)
ValueError: operands could not be broadcast together with shapes (126,) (127,) (126,) 
----------------------------------------------------------------------

https://travis-ci.org/matthew-brett/nipy/jobs/84747582

I wonder whether this is an incompatibility with numpy 1.10 ? I seem to remember numpy changed something subtle with its histogram bin selection in this release.

matthew-brett added a commit that referenced this issue Oct 14, 2015
MRG: make histogram bins integer for numpy 1.10

Numpy 1.10 seems to need an integer input to np.histogram.

Probably fixes gh-369.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant