Closed Taqhee closed 6 years ago
c_options
already has the dtype=np.float64
. The error you're getting is because the input array is not the right dtype
. You could specify it explicitly:
tulipy.kvo(np.array([6407, 6409], dtype=np.float64), np.array([6397.5, 6407.0]), np.array([6407.0,6409.5]), np.array([2910712.0, 1121741.0]), 34.0, 55.0)
but I think the bindings should support any numeric dtype. I'll work up a PR to address this. Thanks!
Please update to 0.3.1
Passing an integer array as either of the options doesn't work in kvo.
For example,
Works after I change [6407, 6409] to [6407.0, 6409.0]
Fix1(init.py) : Convery all options into float in the function definition. Ex: x = [float(i) for i in x]
Fix2 (tulipy/tulipy/lib/init.pyx):
In the class "class _Indicator:" , under def call(self, inputs, options):
Change this line
cdef np.ndarray[np.float64_t, ndim=1, mode='c'] c_options = np.array(option_list)
as
cdef np.ndarray[np.float64_t, ndim=1, mode='c'] c_options = np.array(option_list, dtype=np.float64)