-
Notifications
You must be signed in to change notification settings - Fork 0
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
13 changed files
with
396 additions
and
231 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
name: convert to Heta | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: [ master, '*-result' ] | ||
|
||
jobs: | ||
convert-to-heta: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Installations | ||
run: | | ||
npm i -g heta-compiler | ||
heta -v | ||
- name: Create file structure | ||
run: | | ||
bash ./bash/make-description.sh | ||
- name: copy static | ||
run: | | ||
cp -r static/* result/ | ||
- name: Commit changes to result branch | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: result # The branch the action should deploy to. | ||
FOLDER: result # The folder the action should deploy. | ||
CLEAN: false |
File renamed without changes.
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 |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
|
||
/cases/semantic/julia | ||
/cases/semantic/json.json | ||
|
||
/results | ||
/result |
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,9 @@ | ||
#defineUnit volume { units: metre^3 }; | ||
#defineUnit area { units: metre^2 }; | ||
#defineUnit length { units: metre }; | ||
#defineUnit substance { units: (1e-6 mole) }; | ||
|
||
#include { source: ./model-sbml-l2v5.xml, type: sbml }; | ||
|
||
#export { format: HetaCode }; | ||
#export { format: JSON }; |
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,54 @@ | ||
#!/bin/bash | ||
|
||
echo Create of file structure | ||
mkdir -p result | ||
rm -rf result/* | ||
|
||
echo Collect compiler information | ||
echo "{" > result/summary.json | ||
hetaCompilerVersion=$(heta --version) | ||
echo " \"hetaCompilerVersion\": \"$hetaCompilerVersion\"," >> result/summary.json | ||
started=$(date) | ||
echo " \"started\": \"$started\"," >> result/summary.json | ||
dirs=$(find ./cases/semantic/ -type d -regex '.*/[0-9]+' -print0 | xargs -0 -n1 basename ) # find all directories with numbers | ||
#dirs=$(find ./cases/semantic/ -type f -name "*-sbml-l2v5.xml" -exec dirname {} \; | xargs -n1 basename ) | ||
totalCasesCount=$(echo "$dirs" | wc -l) | ||
echo " \"totalCasesCount\": \"$totalCasesCount\"," >> result/summary.json | ||
|
||
echo Copy files from cases and build models | ||
echo " \"cases\": [" >> result/summary.json | ||
|
||
counter=0 | ||
for dir in $dirs; do | ||
counter=$((counter+1)) | ||
[ $counter==$totalCasesCount ] && delimiter="" || delimiter="," | ||
|
||
mkdir -p result/$dir | ||
cp bash/index.heta result/$dir/index.heta | ||
|
||
# Extract line starting from "synopsis" until the end of line | ||
synopsis=$(sed -n '/(\*/,/*)/p' cases/semantic/$dir/$dir-model.m | sed '1d;$d') | ||
echo "$synopsis" > result/$dir/synopsis.txt | ||
|
||
cp cases/semantic/$dir/$dir-sbml-l2v5.xml result/$dir/model-sbml-l2v5.xml > /dev/null 2>&1 | ||
if [ $? -ne 0 ]; then | ||
echo " {\"id\": \"$dir\", \"retCode\": 9}$delimiter" >> result/summary.json | ||
echo "$dir has no SBML file" | ||
continue | ||
fi | ||
|
||
# supress logs | ||
heta build --skip-updates --dist-dir . --log-mode error result/$dir > /dev/null 2>&1 | ||
retCode=$(echo $?) | ||
echo " {\"id\": \"$dir\", \"retCode\": $retCode}$delimiter" >> result/summary.json | ||
echo "$dir finished with $retCode" | ||
done | ||
|
||
echo " ]," >> result/summary.json | ||
finished=$(date) | ||
echo " \"finished\": \"$finished\"" >> result/summary.json | ||
echo "}" >> result/summary.json | ||
|
||
# Save list of directories in JSON file | ||
# sudo apt-get install jq | ||
# echo "$dirs" | jq -R . | jq -s . > result/dirs.json |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
window.config = { | ||
results: './results.json', | ||
figPath: './cases/output' | ||
figPath: './cases/output', | ||
summaryPath: '/result/summary.json', | ||
}; |
Oops, something went wrong.