8000 `np.multiply` vs. `*` · Issue #7428 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
np.multiply vs. *  #7428
Closed
Closed
@arokem

Description

@arokem

In the course of our work over on dipy, we stumbled into the following behavior:

The following line:
https://github.com/nipy/dipy/blob/master/dipy/denoise/shift_twist_convolution.pyx#L68

raises this error (on np 1.11, but not earlier):

Traceback (most recent call last):
  File "contextual_enhancement.py", line 149, in <module>
    sh_order=8, test_mode=True)
  File "dipy/denoise/shift_twist_convolution.pyx", line 68, in dipy.denoise.shift_twist_convolution.convolve (dipy/denoise/shift_twist_convolution.c:2147)
TypeError: 'numpy.float64' object cannot be interpreted as an index

When changed to this:

https://github.com/stephanmeesters/dipy/blob/enhance_5d_update_pr/dipy/denoise/shift_twist_convolution.pyx#L69

This error no longer occurs. What does the error mean (it's a bit opaque in this context), and how do we avoid it in the future?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0