Instead of
if xj_temp.any() != None:
, can you try
if xj_temp.any() is not None:
I suspect that the != leads to the optimization operator !=, which will build a constraint, and not the comparison you want to achieve.
------------------------------
Vincent Beraudier
------------------------------