I have been getting some strange behaviour when using the -= python operator to construct expressions. Sometimes it works but other times the model fails to solve. Reformulating it as += -(rhs) seems to fix the problem. Looking through the python interface I see that there is an iadd but no isub. I tried to implement one to see if that would fix the issue, but it didn't.
I don't have a simple example to demonstrate this issue, only a larger problem which I can't really send. Anyway I thought I'd put this here as a warning for anyone else (or more likely myself in the future), that is trying to use the -=, /= operators that there might be some issues. From memory I also ran into this issue a long time ago, but likely didn't do anything about it at the time.
I have been getting some strange behaviour when using the -= python operator to construct expressions. Sometimes it works but other times the model fails to solve. Reformulating it as += -(rhs) seems to fix the problem. Looking through the python interface I see that there is an iadd but no isub. I tried to implement one to see if that would fix the issue, but it didn't.
I don't have a simple example to demonstrate this issue, only a larger problem which I can't really send. Anyway I thought I'd put this here as a warning for anyone else (or more likely myself in the future), that is trying to use the -=, /= operators that there might be some issues. From memory I also ran into this issue a long time ago, but likely didn't do anything about it at the time.