Skip to content

Commit

Permalink
Merge pull request #62 from SystemsBioinformatics/dev
Browse files Browse the repository at this point in the history
fixed typo
  • Loading branch information
bgoli authored Nov 2, 2023
2 parents 0146bad + 54beff7 commit aac43c5
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cbmpy/CBModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ def convertUserConstraintsToUserDefinedConstraints(self):

ucnew = self.createUserDefinedConstraint(u, lb, ub, components)
self.addUserDefinedConstraint(ucnew)
print("Markging up model V2 --> V3")
print("Marking up model V2 --> V3")
self.__FBC_VERSION__ = 3

self.user_constraints.clear()
Expand All @@ -1596,7 +1596,7 @@ def copyUserDefinedConstraintsToUserConstraints(self):
ub = numpy.Inf
lb = rhs = udc.getLowerBound()
elif udc.getLowerBound() == numpy.NINF:
operator == "L"
operator = "L"
lb = numpy.NINF
ub = rhs = udc.getUpperBound()
else:
Expand Down
1 change: 1 addition & 0 deletions develop-fbcv3/QP/dbg.lp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Subject To
cons1: R16 + R15 = 0.8
cons2: R15 >= 0.1
cons3: R14 >= 0.1
cons4: R15 <= 1
Bounds
0 <= R01 <= 1
0 <= R10 <= 1000
Expand Down
1 change: 1 addition & 0 deletions develop-fbcv3/QP/test_new_ucs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
print(old_cons[2] - new_cons[2] == 0)



for uc in ucmod.user_defined_constraints:
uc.setAnnotation('secret', uc.getId())
for var in uc.constraint_components:
Expand Down
1 change: 1 addition & 0 deletions develop-fbcv3/QP/test_user_def_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
test.addUserConstraint('cons1', fluxes=[(1, 'R16'), (1, 'R15')], operator='=', rhs=0.8)
test.addUserConstraint('cons2', fluxes=[(1, 'R15')], operator='>=', rhs=0.1)
test.addUserConstraint('cons3', fluxes=[(1, 'R14')], operator='>=', rhs=0.1)
test.addUserConstraint('cons4', fluxes=[(1, 'R15')], operator='<=', rhs=1.0)

lp = cbmpy.CBSolver.cplx_analyzeModel(
test,
Expand Down
2 changes: 1 addition & 1 deletion develop-fbcv3/QP/test_user_def_rc.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- SBML created with CBMPy (0.8.7) on Mon, 30 Oct 2023 23:09:17 -->
<!-- SBML created with CBMPy (0.8.8) on Thu, 02 Nov 2023 15:35:00 -->
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version2" xmlns:html="http://www.w3.org/1999/xhtml" level="3" version="1" fbc:required="false">
<model metaid="meta_sbml_model" id="sbml_model" substanceUnits="mmol_per_gdw" timeUnits="hour" extentUnits="mmol_per_gdw" fbc:strict="true">
<notes>
Expand Down
11 changes: 11 additions & 0 deletions develop-fbcv3/QP/test_user_def_rc.xml.user_constraints.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,16 @@
],
"operator": "G",
"rhs": 0.1
},
"cons4": {
"fluxes": [
[
1,
"R15",
"linear"
]
],
"operator": "L",
"rhs": 1.0
}
}
20 changes: 19 additions & 1 deletion develop-fbcv3/QP/the_third.fbc3.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- SBML created with CBMPy (0.8.7) on Mon, 30 Oct 2023 23:01:37 -->
<!-- SBML created with CBMPy (0.8.8) on Thu, 02 Nov 2023 15:35:10 -->
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version3" xmlns:html="http://www.w3.org/1999/xhtml" level="3" version="1" fbc:required="false">
<model metaid="meta_sbml_model" id="sbml_model" substanceUnits="mmol_per_gdw" timeUnits="hour" extentUnits="mmol_per_gdw" fbc:strict="true">
<notes>
Expand Down Expand Up @@ -120,6 +120,8 @@
<parameter metaid="meta_udcc_cons2_ub" id="udcc_cons2_ub" name="udcc_cons2_ub" value="INF" constant="true"/>
<parameter metaid="meta_udcc_cons3_lb" id="udcc_cons3_lb" name="udcc_cons3_lb" value="0.1" constant="true"/>
<parameter metaid="meta_udcc_cons3_ub" id="udcc_cons3_ub" name="udcc_cons3_ub" value="INF" constant="true"/>
<parameter metaid="meta_udcc_cons4_lb" id="udcc_cons4_lb" name="udcc_cons4_lb" value="-INF" constant="true"/>
<parameter metaid="meta_udcc_cons4_ub" id="udcc_cons4_ub" name="udcc_cons4_ub" value="1" constant="true"/>
</listOfParameters>
<listOfReactions>
<reaction metaid="meta_R01" id="R01" name="R01" reversible="false" fast="false" fbc:lowerFluxBound="bnd_par0" fbc:upperFluxBound="bnd_par1">
Expand Down Expand Up @@ -709,6 +711,22 @@
</fbc:userDefinedConstraintComponent>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
<fbc:userDefinedConstraint fbc:id="cons4" fbc:lowerBound="udcc_cons4_lb" fbc:upperBound="udcc_cons4_ub">
<annotation>
<listOfKeyValuePairs xmlns="http://sbml.org/fbc/keyvaluepair">
<keyValuePair key="secret" value="cons4"/>
</listOfKeyValuePairs>
</annotation>
<fbc:listOfUserDefinedConstraintComponents>
<fbc:userDefinedConstraintComponent fbc:id="udcc_cons4_R15" fbc:coefficient="1" fbc:variable="R15" fbc:variableType="linear">
<annotation>
<listOfKeyValuePairs xmlns="http://sbml.org/fbc/keyvaluepair">
<keyValuePair key="secret" value="udcc_cons4_R15"/>
</listOfKeyValuePairs>
</annotation>
</fbc:userDefinedConstraintComponent>
</fbc:listOfUserDefinedConstraintComponents>
</fbc:userDefinedConstraint>
</fbc:listOfUserDefinedConstraints>
</model>
</sbml>

0 comments on commit aac43c5

Please sign in to comment.