I get a TypeError: unable to find a common ring for all elements.
This seems to be the case because the the constraint function is sometimes called
with a numpy.ndarray and at other times with a sage.modules.vector_real_double_dense.Vector_real_double_dense. In the first case
I need to call float(x[0]), in the latter I can use x[0] directly.

Is it be possible to convert the data to sage vectors throughout the iterations or
do I have to set up a handler to sanitize the input myself?