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 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
The text was updated successfully, but these errors were encountered:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/cbmpy/CBGLPK.py", line 677, in glpk_FluxVariabilityAnalysis
glpk_func_SetObjectiveFunctionAsConstraint(
File "/usr/local/lib/python3.9/site-packages/cbmpy/CBGLPK.py", line 943, in glpk_func_SetObjectiveFunctionAsConstraint
for v_ in range(len(cpx.cols)):
AttributeError: 'SwigPyObject' object has no attribute 'cols'
The pyGLPK version that is currently used is not available for Python 3 so CPLEX is is required ... I am working on a new wrapper that will use the swiglpk used by cobrapy which should resolve all compatibility issues.
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?The text was updated successfully, but these errors were encountered: