Skip to content

Commit

Permalink
Merge pull request #132 from Saityi/ipynb-regression-check
Browse files Browse the repository at this point in the history
Run notebook examples in CI
  • Loading branch information
Saityi authored Aug 22, 2024
2 parents b83f45c + fa49986 commit d636847
Show file tree
Hide file tree
Showing 44 changed files with 2,554 additions and 47,505 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/validate-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check notebook examples for regressions

on: [push, pull_request]

env:
JULIA_NUM_THREADS: 'auto'
jobs:
notebooks-examples-regression-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: 1.9
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- name: Create Julia files from Jupyter Notebook examples
run: |
mkdir ./jlexamples
./ipynb-to-jl.sh "full_fledged_schema_examples"
./ipynb-to-jl.sh "full_fledged_schema_examples_new"
- name: Validate notebook examples by running
run: julia -p auto --project="." -e 'include("./run_notebooks.jl")'
- name: Clean up Julia files from Jupyter Notebook examples
run: rm -rf jlexamples
39 changes: 13 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,22 @@
*.jl.cov
*.jl.mem

examples/.ipynb_checkpoints/

.vscode
.DS_Store

examples/primitive schema examples/.ipynb_checkpoints/

examples/primitive_schema_examples/.ipynb_checkpoints/



examples/primitive_schema_examples/practises/.ipynb_checkpoints/SEIRVD model hard-checkpoint.ipynb

examples/primitive_schema_examples/practises/.ipynb_checkpoints/SEIRVD model-checkpoint.ipynb

examples/primitive_schema_examples/practises/.ipynb_checkpoints/SIRV composition model simple-checkpoint.ipynb

examples/primitive_schema_examples/practises/.ipynb_checkpoints/SIRV composition model-checkpoint.ipynb

examples/primitive_schema_examples/practises/solutions/.ipynb_checkpoints/SIRV composition model-checkpoint.ipynb

examples/full_fledged_schema_examples/.ipynb_checkpoints/composed open population SIRV model-checkpoint.ipynb

examples/full_fledged_schema_examples/.ipynb_checkpoints/
Manifest.toml
.#*

examples/full_fledged_schema_examples/composition/.ipynb_checkpoints/
# Jupyter notebook checkpoints
.ipynb_checkpoints
**/*.ipynb_checkpoints

examples/full_fledged_schema_examples/stratification/.ipynb_checkpoints/
# Vim temporary files:
*~
*.swp
*.swo

examples/full_fledged_schema_examples/CaulsalLoopDiagrams/.ipynb_checkpoints/
# Emacs temporary files
\#*\#
.\#*

Manifest.toml
.#*
2 changes: 0 additions & 2 deletions .vscode/settings.json

This file was deleted.

3 changes: 0 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ AlgebraicRewriting = "725a01d3-f174-5bbd-84e1-b9417bad95d9"
Catlab = "134e5e36-593f-5add-ad60-77f754baafbe"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
CompTime = "0fb5dd42-039a-4ca4-a1d7-89a96eae6d39"
GraphViz = "f526b714-d49f-11e8-06ff-31ed36ee7ee0"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -29,7 +27,6 @@ AlgebraicRewriting = "0.2.1 - 0.3.2, 0.4"
Catlab = "0.15.5 - 0.16.8, 0.16"
Combinatorics = "1.0.2"
CompTime = "0.1"
GraphViz = "0.2"
Graphs = "1.9.0"
JSON = "0.21.0"
LabelledArrays = "^1"
Expand Down
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
AlgebraicRewriting = "725a01d3-f174-5bbd-84e1-b9417bad95d9"
Catlab = "134e5e36-593f-5add-ad60-77f754baafbe"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GraphViz = "f526b714-d49f-11e8-06ff-31ed36ee7ee0"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # Convert from SEIR Stock Flow Diagram

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # COVID Full Model

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # SEIR Full Model Measles Chickenpox

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # Composed Open Population SIRV Model

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # Curable Sexually-Transmitted Diseases Model

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # Diabetes Model

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # Diabetes Diagnose

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # SIR Linear Stratification

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# # SIR Standard Stratification

using GraphViz

using StockFlow
using StockFlow.Syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1342,21 +1342,21 @@
}
],
"source": [
"Graph(seir_causalLoop)"
"GraphCL(seir_causalLoop)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.2",
"display_name": "Julia 1.10.4",
"language": "julia",
"name": "julia-1.9"
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.2"
"version": "1.10.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
"source": [
"# test the causal loop diagram\n",
"si_causalLoop=CausalLoop(\n",
" (:S,:i,:I),\n",
" (:S=>:i,:i=>:S,:i=>:I,:I=>:i)\n",
" [:S,:i,:I],\n",
" [:S=>:i,:i=>:S,:i=>:I,:I=>:i]\n",
")"
]
},
Expand Down Expand Up @@ -186,21 +186,21 @@
}
],
"source": [
"Graph(si_causalLoop)"
"GraphCL(si_causalLoop)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.7.3",
"display_name": "Julia 1.10.4",
"language": "julia",
"name": "julia-1.7"
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.3"
"version": "1.10.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@
"source": [
"# define a foot of the structured multicospan\n",
"footS=foot(:S, :N, :S=>:N)\n",
"Graph(footS;schema=\"C0\")"
"StockFlow.Graph(footS;schema=\"C0\")"
]
},
{
Expand All @@ -970,7 +970,7 @@
"source": [
"# define a foot of the structured multicospan\n",
"footI=foot(:I, :N, :I=>:N)\n",
"Graph(footI;schema=\"C0\")"
"StockFlow.Graph(footI;schema=\"C0\")"
]
},
{
Expand Down Expand Up @@ -2114,9 +2114,7 @@
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -2543,9 +2541,7 @@
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -6059,9 +6055,7 @@
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -9921,9 +9915,7 @@
{
"cell_type": "code",
"execution_count": 46,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -10756,21 +10748,21 @@
],
"source": [
"causalloop=convertToCausalLoop(SIRstructure)\n",
"Graph(causalloop)"
"GraphCL(causalloop)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.2",
"display_name": "Julia 1.10.4",
"language": "julia",
"name": "julia-1.9"
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.2"
"version": "1.10.4"
}
},
"nbformat": 4,
Expand Down
Loading

2 comments on commit d636847

@neonWhiteout
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/113693

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.3 -m "<description of version>" d6368471945d7723aeeac8493854c457bd287e33
git push origin v0.2.3

Please sign in to comment.