-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Milestone
Description
I see errors with cbmpy.CBGLPK.glpk_FluxVariabilityAnalysis
in 0.8.1 and swiglpk 4.65.1, 5.0.0, and 5.0.3 from PyPI. Is a newer version of swiglpk needed?
> solution = cbmpy.CBGLPK.glpk_FluxVariabilityAnalysis(model)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../.local/lib/python3.9/site-packages/cbmpy/CBGLPK.py:677: in glpk_FluxVariabilityAnalysis
glpk_func_SetObjectiveFunctionAsConstraint(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cpx = <Swig Object of type 'glp_prob *' at 0x7f3a5dc5d060>, rhs_sense = 'lower', oval = 0.8739215069684909, tol = None, optPercentage = 100.0
def glpk_func_SetObjectiveFunctionAsConstraint(
cpx, rhs_sense, oval, tol, optPercentage
):
"""
Take the objective function and "optimum" value and add it as a constraint
- *cpx* a cplex object
- *oval* the objective value
- *tol* [default=None] do not floor/ceiling the objective function constraint, otherwise round of to *tol*
- *rhs_sense* [default='lower'] means objC >= objVal the inequality to use for the objective constraint can also be *upper* or *equal*
- *optPercentage* [default=100.0] means the percentage optimal value to use for the RHS of the objective constraint: optimal_value*(optPercentage/100.0)
"""
# generate new constraint from old objective value (use non-zero coefficients)
LCS = []
LCN = []
new_constraint = []
> for v_ in range(len(cpx.cols)):
E AttributeError: 'SwigPyObject' object has no attribute 'cols'
../../.local/lib/python3.9/site-packages/cbmpy/CBGLPK.py:943: AttributeError
Metadata
Metadata
Assignees
Labels
No labels