Version Checks (indicate both or one)
Issue Description
When constants are supplied to a linopy model, the model appears to introduce these only based on order, not match them based on the relevant coordinates.
Reproducible Example
import linopy
m = linopy.Model()
idx = ["A1", "A5", "A11", "A100"]
x = m.add_variables(coords=[idx], name="x")
idx2 = ["A100", "A1", "A5", "A11"]
coef = pd.Series({i: int(i[1:]) for i in idx2})
m.add_constraints(x >= coef)
Expected Behavior
linopy should build the constraint so that the variables are matched with the constant of the same index.
[A1]: +1 x[A1] ≥ 100.0
[A5]: +1 x[A5] ≥ 1.0
[A11]: +1 x[A11] ≥ 11.0
[A100]: +1 x[A100] ≥ 5.0
Instead, it returns a constraint of the form:
[A1]: +1 x[A1] ≥ 1.0
[A5]: +1 x[A5] ≥ 5.0
[A11]: +1 x[A11] ≥ 11.0
[A100]: +1 x[A100] ≥ 100.0
Installed Versions
Details
0.5.8
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of Linopy.
I have confirmed this bug exists on the current
masterbranch of Linopy.Issue Description
When constants are supplied to a linopy model, the model appears to introduce these only based on order, not match them based on the relevant coordinates.
Reproducible Example
Expected Behavior
linopy should build the constraint so that the variables are matched with the constant of the same index.
Instead, it returns a constraint of the form:
Installed Versions
Details
0.5.8