-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Test Matlab interface on GHA (#1451)
Compiles and runs a subset of Matlab examples on GHA. Should prevent regularly breaking the Matlab interface... Reports missed expectations, but does not fail. Currently, '/model_steadystate/sensifwdbyhandpreeq' reports wrong sx0, sx, sy and sllh, independently of these changes. Closes #1449 * CI: Test Matlab interface on GHA * Fix model_neuron test config; regenerate expected results; m-file for recompilation, tests to GHA * Update doc
- Loading branch information
Showing
29 changed files
with
145 additions
and
32 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,21 @@ | ||
name: Matlab | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
matlab: | ||
name: Matlab | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- run: git fetch --prune --unshallow | ||
|
||
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV | ||
|
||
- name: Install MATLAB | ||
uses: matlab-actions/setup-matlab@v0 | ||
- name: Run script | ||
uses: matlab-actions/run-command@v0 | ||
with: | ||
command: cd matlab; installAMICI; addpath tests; testModels |
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
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
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,26 @@ | ||
function generateRebuildM(this) | ||
% generateRebuildM generates a Matlab script for recompilation of this | ||
% model | ||
% | ||
% Return values: | ||
% void | ||
|
||
|
||
filename = fullfile(this.wrap_path,'models',this.modelname,['rebuild_',this.modelname,'.m']); | ||
% would require struct to string conversion, skipping for now | ||
amimodelo2 = '[]'; | ||
|
||
fid = fopen(filename, 'w'); | ||
|
||
fprintf(fid, ['function ' ['rebuild_', this.modelname] '()\n']); | ||
fprintf(fid, ['modelName = ''' this.modelname ''';\n']); | ||
fprintf(fid, 'amimodel.compileAndLinkModel(modelName, '''', [], [], [], []);\n'); | ||
fprintf(fid, ['amimodel.generateMatlabWrapper(' num2str(this.nx) ', ' num2str(this.ny) ... | ||
', ' num2str(this.np) ', ' num2str(this.nk) ', ' num2str(this.nz) ', ' num2str(this.o2flag) ', ' ... | ||
amimodelo2 ', [''simulate_'' modelName ''.m''], ''' ... | ||
this.modelname ''', ''' this.param ''', ' num2str(this.forward) ', ' num2str(this.adjoint) ');\n']); | ||
fprintf(fid, 'end\n'); | ||
|
||
fclose(fid); | ||
end | ||
|
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
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
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
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,5 @@ | ||
function rebuild_model_calvetti() | ||
modelName = 'model_calvetti'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(6, 6, 0, 6, 0, 0, [], ['simulate_' modelName '.m'], 'model_calvetti', 'lin', 1, 1); | ||
end |
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
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,5 @@ | ||
function rebuild_model_dirac() | ||
modelName = 'model_dirac'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(2, 1, 4, 0, 0, 0, [], ['simulate_' modelName '.m'], 'model_dirac', 'log10', 1, 1); | ||
end |
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
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,5 @@ | ||
function rebuild_model_events() | ||
modelName = 'model_events'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(3, 1, 4, 4, 2, 0, [], ['simulate_' modelName '.m'], 'model_events', 'log10', 1, 1); | ||
end |
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
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,5 @@ | ||
function rebuild_model_jakstat_adjoint() | ||
modelName = 'model_jakstat_adjoint'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(9, 3, 17, 2, 0, 0, [], ['simulate_' modelName '.m'], 'model_jakstat_adjoint', 'log10', 1, 1); | ||
end |
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
Binary file not shown.
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
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,5 @@ | ||
function rebuild_model_nested_events() | ||
modelName = 'model_nested_events'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(1, 1, 5, 0, 0, 0, [], ['simulate_' modelName '.m'], 'model_nested_events', 'log10', 1, 1); | ||
end |
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
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,5 @@ | ||
function rebuild_model_neuron() | ||
modelName = 'model_neuron'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(2, 1, 4, 2, 1, 0, [], ['simulate_' modelName '.m'], 'model_neuron', 'log10', 1, 1); | ||
end |
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
Binary file not shown.
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
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,5 @@ | ||
function rebuild_model_robertson() | ||
modelName = 'model_robertson'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(3, 3, 3, 1, 0, 0, [], ['simulate_' modelName '.m'], 'model_robertson', 'log10', 1, 1); | ||
end |
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
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,5 @@ | ||
function rebuild_model_steadystate() | ||
modelName = 'model_steadystate'; | ||
amimodel.compileAndLinkModel(modelName, '', [], [], [], []); | ||
amimodel.generateMatlabWrapper(3, 3, 5, 4, 0, 0, [], ['simulate_' modelName '.m'], 'model_steadystate', 'log10', 1, 1); | ||
end |
Binary file not shown.
Binary file not shown.
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