-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 0502_GvSelfTransport | ||
|
||
tries to create a set of 2 units of the Selkov-Wolf-Heinrich model where the graphviz file has a self connection | ||
|
||
## tests | ||
|
||
- 1D, network, directed | ||
- file reads well | ||
- gv file reads well | ||
- issues a warning that the slef connection will be ignored | ||
- produces no other warning or error (ignores bad node) | ||
- tests -o option to name output file | ||
- checks that the self connection was ignored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# work out our folder name | ||
test=${PWD##*/} # to assign to a variable | ||
test=${test:-/} # to correct for the case where PWD=/ | ||
|
||
# run sbmodelr | ||
../../sbmodelr -t X -n ../sources/self.gv -o ISC.cps ../sources/Selkov-Wolf-Heinrich.cps 2 > output | ||
|
||
fail=0 | ||
|
||
# compare output and target | ||
difference=$(diff output target_stdout) | ||
if [[ $difference ]]; then | ||
printf 'FAIL %s\n' "${test}" | ||
fail=1 | ||
fi | ||
|
||
# test -o option by checking if output file was created | ||
if ! [ -f ISC.cps ]; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 2" | ||
fi | ||
|
||
# create model summary | ||
../model_report.py ISC.cps >/dev/null | ||
if ! [[ $? = 0 ]]; then | ||
printf 'FAIL %s\n' "${test}" | ||
exit -1 | ||
fi | ||
|
||
# check that there is a transport reaction 1->2 | ||
if ! grep -Pq "t_X_1-2\s+X_1 -> X_2" ISC.summary.txt; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 2" | ||
fi | ||
|
||
# check that there is no transport reaction 2->2 | ||
if grep -Pq "t_X_2-2\s+X_2 -> X_2" ISC.summary.txt; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 4" | ||
fi | ||
|
||
# check that there is only one transport constant | ||
n=$(grep -Pc "^k_.+_transport\s+fixed" ISC.summary.txt ) | ||
if ((n != 1)) ; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 8" | ||
fi | ||
|
||
if [ "$fail" = 0 ] ; then | ||
printf 'PASS %s\n' "${test}" | ||
rm ISC.summary.txt output *.cps | ||
fi | ||
|
||
exit $fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Processing ../sources/Selkov-Wolf-Heinrich.cps | ||
Reactions: 3 | ||
Species: 2 (Reactions: 2, Fixed: 0, Assignment: 0, ODE: 0) | ||
Compartments: 1 (Fixed: 1, Assignment: 0, ODE: 0) | ||
Global quantities: 2 (Fixed: 2, Assignment: 0, ODE: 0) | ||
Events: 0 (Only time-dependent: 0, variable-dependent: 0) | ||
Network: directed (Nodes: 2, Edges: 2) | ||
Warning: transport on the same unit not allowed, ignoring 2 -> 2 | ||
created new model ISC.cps with a set of 2 replicas of ../sources/Selkov-Wolf-Heinrich.cps | ||
|