Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
c18a994e
Unverified
Commit
c18a994e
authored
3 years ago
by
St. Elmo
Browse files
Options
Downloads
Patches
Plain Diff
added more tests
parent
6c2b6204
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/reconstruction/CoreModel.jl
+13
-3
13 additions, 3 deletions
test/reconstruction/CoreModel.jl
test/reconstruction/StandardModel.jl
+22
-6
22 additions, 6 deletions
test/reconstruction/StandardModel.jl
with
35 additions
and
9 deletions
test/reconstruction/CoreModel.jl
+
13
−
3
View file @
c18a994e
...
...
@@ -12,9 +12,14 @@ using Base: lowerbound, upperbound
change_bound!
(
cp
,
"r1"
,
lower_bound
=-
101
,
upper_bound
=
101
)
@test
cp
.
xl
[
1
]
==
-
101
@test
cp
.
xu
[
1
]
==
101
change_bounds!
(
cp
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
113
,
-
12.23
],
upper_bounds
=
[
11
3
,
233.0
])
change_bounds!
(
cp
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
113
,
-
12.23
],
upper_bounds
=
[
11
4
,
233.0
])
@test
cp
.
xl
[
2
]
==
-
12.23
@test
cp
.
xu
[
1
]
==
113
@test
cp
.
xu
[
1
]
==
114
change_bounds!
(
cp
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
114
,
nothing
],
upper_bounds
=
[
nothing
,
2333.0
])
@test
cp
.
xl
[
1
]
==
-
114
@test
cp
.
xl
[
2
]
==
-
12.23
@test
cp
.
xu
[
1
]
==
114
@test
cp
.
xu
[
2
]
==
2333
new_model
=
change_bound
(
cp
,
1
,
lower_bound
=-
10
,
upper_bound
=
10
)
@test
new_model
.
xl
[
1
]
==
-
10
...
...
@@ -26,9 +31,14 @@ using Base: lowerbound, upperbound
new_model
=
change_bound
(
cp
,
"r1"
,
lower_bound
=-
101
,
upper_bound
=
101
)
@test
new_model
.
xl
[
1
]
==
-
101
@test
new_model
.
xu
[
1
]
==
101
new_model
=
change_bounds
(
cp
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
113
,
-
12.23
],
upper_bounds
=
[
113
,
233.
0
])
new_model
=
change_bounds
(
cp
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
113
,
-
12.23
],
upper_bounds
=
[
113
,
100
0
])
@test
new_model
.
xl
[
2
]
==
-
12.23
@test
new_model
.
xu
[
1
]
==
113
new_model
=
change_bounds
(
cp
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
nothing
,
-
10
],
upper_bounds
=
[
110
,
nothing
])
@test
new_model
.
xl
[
1
]
==
-
114
@test
new_model
.
xl
[
2
]
==
-
10
@test
new_model
.
xu
[
1
]
==
110
@test
new_model
.
xu
[
2
]
==
2333
end
@testset
"Verify consistency"
begin
...
...
This diff is collapsed.
Click to expand it.
test/reconstruction/StandardModel.jl
+
22
−
6
View file @
c18a994e
...
...
@@ -36,24 +36,40 @@
change_bound!
(
model
,
"r2"
;
lower_bound
=-
10
,
upper_bound
=
10
)
@test
model
.
reactions
[
"r2"
]
.
lb
==
-
10
@test
model
.
reactions
[
"r2"
]
.
ub
==
10
change_bounds!
(
model
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
10
,
-
20
],
upper_bounds
=
[
10.0
,
20.0
])
@test
model
.
reactions
[
"r1"
]
.
lb
==
-
10
@test
model
.
reactions
[
"r1"
]
.
ub
==
10
@test
model
.
reactions
[
"r2"
]
.
lb
==
-
20
@test
model
.
reactions
[
"r2"
]
.
ub
==
20
change_bound!
(
model
,
"r2"
;
lower_bound
=-
100
)
@test
model
.
reactions
[
"r2"
]
.
lb
==
-
100
@test
model
.
reactions
[
"r2"
]
.
ub
==
10
change_bound!
(
model
,
"r2"
;
upper_bound
=
111
)
@test
model
.
reactions
[
"r2"
]
.
lb
==
-
100
@test
model
.
reactions
[
"r2"
]
.
ub
==
111
change_bounds!
(
model
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
110
,
-
220
],
upper_bounds
=
[
110.0
,
220.0
])
@test
model
.
reactions
[
"r1"
]
.
lb
==
-
110
@test
model
.
reactions
[
"r1"
]
.
ub
==
110
@test
model
.
reactions
[
"r2"
]
.
lb
==
-
220
@test
model
.
reactions
[
"r2"
]
.
ub
==
220
# change bound - new model
new_model
=
change_bound
(
model
,
"r2"
;
lower_bound
=-
10
,
upper_bound
=
10
)
@test
new_model
.
reactions
[
"r2"
]
.
lb
==
-
10
@test
new_model
.
reactions
[
"r2"
]
.
ub
==
10
new_model
=
change_bound
(
model
,
"r2"
;
lower_bound
=-
10
)
@test
new_model
.
reactions
[
"r2"
]
.
lb
==
-
10
@test
new_model
.
reactions
[
"r2"
]
.
ub
==
220
new_model
=
change_bounds
(
model
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
10
,
-
20
],
upper_bounds
=
[
10.0
,
20.0
])
@test
new_model
.
reactions
[
"r1"
]
.
lb
==
-
10
@test
new_model
.
reactions
[
"r1"
]
.
ub
==
10
@test
new_model
.
reactions
[
"r2"
]
.
lb
==
-
20
@test
new_model
.
reactions
[
"r2"
]
.
ub
==
20
new_model
=
change_bounds
(
model
,
[
"r1"
,
"r2"
];
lower_bounds
=
[
-
10
,
nothing
],
upper_bounds
=
[
nothing
,
20.0
])
@test
new_model
.
reactions
[
"r1"
]
.
lb
==
-
10
@test
new_model
.
reactions
[
"r1"
]
.
ub
==
110
@test
new_model
.
reactions
[
"r2"
]
.
lb
==
-
220
@test
new_model
.
reactions
[
"r2"
]
.
ub
==
20
### reactions
add_reactions!
(
model
,
[
r3
,
r4
])
@test
length
(
model
.
reactions
)
==
4
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment