-
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
2 changed files
with
91 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,14 @@ | ||
# 0509_Tasks | ||
|
||
tests errors/warnings related with setting up tasks | ||
|
||
## tests | ||
|
||
- 1D 2D, network, grid, transport, synaptic | ||
- appropriate warning when model has scan over parameter sets | ||
- appropriate warning when model has parameter scan | ||
- appropriate warning when model cross section | ||
- appropriate warning for model with a parameter estimation | ||
- appropriate warning for model with a sensitivity analysis | ||
- appropriate warning for model with optimization | ||
- appropriate warning for model with active time course sensitivities |
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,77 @@ | ||
#!/bin/bash | ||
|
||
# work out our folder name | ||
test=${PWD##*/} # to assign to a variable | ||
test=${test:-/} # to correct for the case where PWD=/ | ||
|
||
fail=0 | ||
|
||
# test model that has scan over parameter sets | ||
sbmodelr -t M1 ../sources/multimodel.cps 2 2 > output 2>&1 | ||
|
||
# check that the correct warning is issued | ||
if ! grep -q " Warning: a scan of parameter sets exists in the original model but was not included in the new model." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = 1" | ||
fi | ||
|
||
# check that the other warning is also issued | ||
if ! grep -q " Warning: in Parameter scan task the scanned or sampled items were converted to those of the first unit only." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 2" | ||
fi | ||
|
||
# test model with a cross section | ||
sbmodelr -t Y ../sources/crossect.cps 2 2 > output 2>&1 | ||
|
||
# check that the correct warning is issued for cross section | ||
if ! grep -q " Warning: the cross section task was updated to use \[X_1,1\] as variable." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 4" | ||
fi | ||
|
||
# check that the correct warning is issued for parameter scan | ||
if ! grep -q " Warning: in Parameter scan task the scanned or sampled items were converted to those of the first unit only." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 8" | ||
fi | ||
|
||
# test model with a sensitivity analysis | ||
sbmodelr -t B ../sources/sens.cps 2 > output 2>&1 | ||
|
||
# check that the correct warning is issued | ||
if ! grep -q " Warning: sensitivies task is now using items of unit " output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 16" | ||
fi | ||
|
||
# test model with optimization | ||
sbmodelr -t X ../sources/opt.cps 2 > output 2>&1 | ||
|
||
# check that the correct warning is issued | ||
if ! grep -q " Warning: in Optimization task the objective function and the search parameters were converted to those of the first unit only." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 32" | ||
fi | ||
|
||
# test model with parameter estimation | ||
sbmodelr -t E1 ../sources/pe_tcs.cps 2 > output 2>&1 | ||
|
||
# check that the correct warning is issued | ||
if ! grep -q " Warning: Parameter Estimation task settings were not copied to the new model." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 64" | ||
fi | ||
|
||
# check that the correct warning is issued for time course sensitivities | ||
if ! grep -q " Warning: Time Course Sensitivities task settings were not copied to the new model." output; then | ||
printf 'FAIL %s\n' "${test}" | ||
let "fail = $fail + 128" | ||
fi | ||
|
||
if [ "$fail" = 0 ] ; then | ||
printf 'PASS %s\n' "${test}" | ||
rm output *.cps > /dev/null 2>&1 | ||
fi | ||
|
||
exit $fail |