Vague warning for cbc highs dependency. Cannot have Variable objective · Issue #452 · PyPSA/linopy · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have confirmed this bug exists on the lastest release of Linopy.
I have confirmed this bug exists on the current master branch of Linopy.
Issue Description
If you try to use CBC solver without highspy installed you get a vague "NameError"
If you try to pass a variable to add_objective, it gets caught by the type checker
Reproducible Example
# Example 1importlinopymodel=linopy.Model()
x=model.add_variables(name="x", lower=0.0)
model.add_constraints(x>=0.0)
model.add_objective(x*1.0, sense="min")
model.solve(solver_name="cbc") # NameError: name 'highspy' is not defined# Example 2importlinopymodel=linopy.Model()
x=model.add_variables(name="x", lower=0.0)
model.add_constraints(x>=0.0)
model.add_objective(x, sense="min") # ValueError: Invalid type of `expr`
Expected Behavior
I expect to get a useful message to say that highspy should be installed to use cbc
I expect to be able to pass a Variable to the add_objective message
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
master
branch of Linopy.Issue Description
If you try to use CBC solver without highspy installed you get a vague "NameError"
If you try to pass a variable to add_objective, it gets caught by the type checker
Reproducible Example
Expected Behavior
I expect to get a useful message to say that highspy should be installed to use cbc
I expect to be able to pass a Variable to the add_objective message
Installed Versions
The text was updated successfully, but these errors were encountered: