Re: [Numpy-discussion] using scalar and tuple/list input on np.PyArray_MultiIterNew2

2021-01-11 Thread zoj613
No, The function is what I ended up with, I just forgot to change (h, z) to (a, b). It works fine. Yes, I want to ensure that I end up with a double type even if an integer value is passed. I didn't think of unconditionally using np.PyArray_From_OT() even for scalars. I guess that is probably a bet

Re: [Numpy-discussion] using scalar and tuple/list input on np.PyArray_MultiIterNew2

2021-01-11 Thread Sebastian Berg
On Sun, 2021-01-10 at 14:18 -0700, zoj613 wrote: > For what it's worth, I ended up defining a function like: > cdef np.broadcast broadcast(object a, object b): >     """ >     Broadcast the inputs into a multiIterator object. >     the input can be a scalar, list, tuple or numpy array or > array_li

Re: [Numpy-discussion] using scalar and tuple/list input on np.PyArray_MultiIterNew2

2021-01-10 Thread zoj613
For what it's worth, I ended up defining a function like: cdef np.broadcast broadcast(object a, object b): """ Broadcast the inputs into a multiIterator object. the input can be a scalar, list, tuple or numpy array or array_like object. """ cdef bint is_a_seq = is_sequence(h)