Skip to content

Commit 54beff7

Browse files
committed
fixed typo, thanks to Steven for reporting this
1 parent 2bc696c commit 54beff7

File tree

7 files changed

+36
-4
lines changed

7 files changed

+36
-4
lines changed

cbmpy/CBModel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ def convertUserConstraintsToUserDefinedConstraints(self):
15701570

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

15761576
self.user_constraints.clear()
@@ -1596,7 +1596,7 @@ def copyUserDefinedConstraintsToUserConstraints(self):
15961596
ub = numpy.Inf
15971597
lb = rhs = udc.getLowerBound()
15981598
elif udc.getLowerBound() == numpy.NINF:
1599-
operator == "L"
1599+
operator = "L"
16001600
lb = numpy.NINF
16011601
ub = rhs = udc.getUpperBound()
16021602
else:

develop-fbcv3/QP/dbg.lp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Subject To
2626
cons1: R16 + R15 = 0.8
2727
cons2: R15 >= 0.1
2828
cons3: R14 >= 0.1
29+
cons4: R15 <= 1
2930
Bounds
3031
0 <= R01 <= 1
3132
0 <= R10 <= 1000

develop-fbcv3/QP/test_new_ucs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
print(old_cons[2] - new_cons[2] == 0)
4040

4141

42+
4243
for uc in ucmod.user_defined_constraints:
4344
uc.setAnnotation('secret', uc.getId())
4445
for var in uc.constraint_components:

develop-fbcv3/QP/test_user_def_rc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
test.addUserConstraint('cons1', fluxes=[(1, 'R16'), (1, 'R15')], operator='=', rhs=0.8)
1212
test.addUserConstraint('cons2', fluxes=[(1, 'R15')], operator='>=', rhs=0.1)
1313
test.addUserConstraint('cons3', fluxes=[(1, 'R14')], operator='>=', rhs=0.1)
14+
test.addUserConstraint('cons4', fluxes=[(1, 'R15')], operator='<=', rhs=1.0)
1415

1516
lp = cbmpy.CBSolver.cplx_analyzeModel(
1617
test,

develop-fbcv3/QP/test_user_def_rc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- SBML created with CBMPy (0.8.7) on Mon, 30 Oct 2023 23:09:17 -->
2+
<!-- SBML created with CBMPy (0.8.8) on Thu, 02 Nov 2023 15:35:00 -->
33
<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">
44
<model metaid="meta_sbml_model" id="sbml_model" substanceUnits="mmol_per_gdw" timeUnits="hour" extentUnits="mmol_per_gdw" fbc:strict="true">
55
<notes>

develop-fbcv3/QP/test_user_def_rc.xml.user_constraints.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,16 @@
3636
],
3737
"operator": "G",
3838
"rhs": 0.1
39+
},
40+
"cons4": {
41+
"fluxes": [
42+
[
43+
1,
44+
"R15",
45+
"linear"
46+
]
47+
],
48+
"operator": "L",
49+
"rhs": 1.0
3950
}
4051
}

develop-fbcv3/QP/the_third.fbc3.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- SBML created with CBMPy (0.8.7) on Mon, 30 Oct 2023 23:01:37 -->
2+
<!-- SBML created with CBMPy (0.8.8) on Thu, 02 Nov 2023 15:35:10 -->
33
<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">
44
<model metaid="meta_sbml_model" id="sbml_model" substanceUnits="mmol_per_gdw" timeUnits="hour" extentUnits="mmol_per_gdw" fbc:strict="true">
55
<notes>
@@ -120,6 +120,8 @@
120120
<parameter metaid="meta_udcc_cons2_ub" id="udcc_cons2_ub" name="udcc_cons2_ub" value="INF" constant="true"/>
121121
<parameter metaid="meta_udcc_cons3_lb" id="udcc_cons3_lb" name="udcc_cons3_lb" value="0.1" constant="true"/>
122122
<parameter metaid="meta_udcc_cons3_ub" id="udcc_cons3_ub" name="udcc_cons3_ub" value="INF" constant="true"/>
123+
<parameter metaid="meta_udcc_cons4_lb" id="udcc_cons4_lb" name="udcc_cons4_lb" value="-INF" constant="true"/>
124+
<parameter metaid="meta_udcc_cons4_ub" id="udcc_cons4_ub" name="udcc_cons4_ub" value="1" constant="true"/>
123125
</listOfParameters>
124126
<listOfReactions>
125127
<reaction metaid="meta_R01" id="R01" name="R01" reversible="false" fast="false" fbc:lowerFluxBound="bnd_par0" fbc:upperFluxBound="bnd_par1">
@@ -709,6 +711,22 @@
709711
</fbc:userDefinedConstraintComponent>
710712
</fbc:listOfUserDefinedConstraintComponents>
711713
</fbc:userDefinedConstraint>
714+
<fbc:userDefinedConstraint fbc:id="cons4" fbc:lowerBound="udcc_cons4_lb" fbc:upperBound="udcc_cons4_ub">
715+
<annotation>
716+
<listOfKeyValuePairs xmlns="http://sbml.org/fbc/keyvaluepair">
717+
<keyValuePair key="secret" value="cons4"/>
718+
</listOfKeyValuePairs>
719+
</annotation>
720+
<fbc:listOfUserDefinedConstraintComponents>
721+
<fbc:userDefinedConstraintComponent fbc:id="udcc_cons4_R15" fbc:coefficient="1" fbc:variable="R15" fbc:variableType="linear">
722+
<annotation>
723+
<listOfKeyValuePairs xmlns="http://sbml.org/fbc/keyvaluepair">
724+
<keyValuePair key="secret" value="udcc_cons4_R15"/>
725+
</listOfKeyValuePairs>
726+
</annotation>
727+
</fbc:userDefinedConstraintComponent>
728+
</fbc:listOfUserDefinedConstraintComponents>
729+
</fbc:userDefinedConstraint>
712730
</fbc:listOfUserDefinedConstraints>
713731
</model>
714732
</sbml>

0 commit comments

Comments
 (0)