PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
153 stars 40 forks source link

properly handle constraint assignment with constants when using args #274

Closed FabianHofmann closed 2 months ago

FabianHofmann commented 2 months ago

closes #270

The constraint assignment with a LinearExpression and a constant value when using the pattern model.add_constraints(lhs_with_constant, sign, rhs) was fixed. Before, the constant value was not added to the right-hand-side properly which led to the wrong constraint behavior. This is fixed now.