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
Is ravel_multi_index a new thing? #53
Comments
ravel_multi_index is new as of numpy 1.6. Any thoughts anybody on how we should fix this? Bago |
For what it's worth, 'bincount' was also added only in 1.6, so that might also raise problems. How about using np.histogram on the ravel'ed array, with the number of bins set such that each one catches the interval containing only a single integer and then reshaping that to the shape you want (mx,mx)? |
I think bincount has been around forever... |
lol, I just ran into this. The minlength keyword is new as of numpy ~1.6 Bago On Wed, Aug 8, 2012 at 9:28 PM, Stefan van der Walt <
|
Oh yeah - my bad. On Wed, Aug 8, 2012 at 11:31 PM, MrBago notifications@github.com wrote:
|
Closed through #55 |
Reducing code complexity
The Travis bot seems to choke on np.ravel_multi_index. Is that a new thing?
5103ERROR: dipy.tracking.tests.test_utils.test_connectivity_matrix
5104----------------------------------------------------------------------
5105Traceback (most recent call last):
5106 File "/usr/lib/pymodules/python2.7/nose/case.py", line 187, in runTest
5107 self.test(_self.arg)
5108 File "/usr/local/lib/python2.7/dist-packages/dipy/tracking/tests/test_utils.py", line 56, in test_connectivity_matrix
5109 matrix = connectivity_matrix(streamlines, label_volume, (1, 1, 1))
5110 File "/usr/local/lib/python2.7/dist-packages/dipy/tracking/utils.py", line 123, in connectivity_matrix
5111 matrix = ndbincount(endlabels, shape=(mx, mx))
5112 File "/usr/local/lib/python2.7/dist-packages/dipy/tracking/utils.py", line 151, in ndbincount
5113 x = np.ravel_multi_index(x, shape)
5114AttributeError: 'module' object has no attribute 'ravel_multi_index'
5115
5116======================================================================
5117ERROR: dipy.tracking.tests.test_utils.test_ndbincount
5118----------------------------------------------------------------------
5119Traceback (most recent call last):
5120 File "/usr/lib/pymodules/python2.7/nose/case.py", line 187, in runTest
5121 self.test(_self.arg)
5122 File "/usr/local/lib/python2.7/dist-packages/dipy/tracking/tests/test_utils.py", line 91, in test_ndbincount
5123 bc = ndbincount(x)
5124 File "/usr/local/lib/python2.7/dist-packages/dipy/tracking/utils.py", line 151, in ndbincount
5125 x = np.ravel_multi_index(x, shape)
5126AttributeError: 'module' object has no attribute 'ravel_multi_index'
The text was updated successfully, but these errors were encountered: