AlgebraicJulia / StockFlow.jl

https://algebraicjulia.github.io/StockFlow.jl/
MIT License
65 stars 6 forks source link

Run notebook examples in CI #132

Closed Saityi closed 2 months ago

Saityi commented 2 months ago

Issue

Our notebook examples easily go out of date, and it's hard to notice when it happens without a regular CI checking them

Fix

Convert notebook examples to Julia code and run them

Fix errors CI exposed:

Notes

Includes commits from #131 and verifies removing GraphViz did not break any examples. @KevinDCarlson

Also addresses https://github.com/AlgebraicJulia/StockFlow.jl/issues/113#issuecomment-1861809454

Misc

These tests can be run locally by running the helper script, validate-notebook-examples.sh, which does what the workflow does:

$ validate-notebook-examples.sh
Starting to run notebooks ...
Checking: ["./jlexamples/full_fledged_schema_examples.COVID_full_model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.Pertussis Model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.SEIR_full_model_measles_chickenpox.ipynb.jl", "./jlexamples/full_fledged_schema_examples.SIR_example_function_structure_test_compostion_and_stratification.ipynb.jl", "./jlexamples/full_fledged_schema_examples.composed open population SIRV model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.convert_from_SEIR_stockFlowDiagram.ipynb.jl", "./jlexamples/full_fledged_schema_examples.create_a_causalLoopDiagram.ipynb.jl", "./jlexamples/full_fledged_schema_examples.curable sexually transmitted diseases model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.diabetes model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.diabetes_diagnose.ipynb.jl", "./jlexamples/full_fledged_schema_examples.sex_transmission_SIS.ipynb.jl", "./jlexamples/full_fledged_schema_examples_new.COVID_full_model.ipynb.jl", "./jlexamples/
OK: Any["./jlexamples/full_fledged_schema_examples.COVID_full_model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.Pertussis Model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.SEIR_full_model_measles_chickenpox.ipynb.jl", "./jlexamples/full_fledged_schema_examples.SIR_example_function_structure_test_compostion_and_stratification.ipynb.jl", "./jlexamples/full_fledged_schema_examples.composed open population SIRV model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.convert_from_SEIR_stockFlowDiagram.ipynb.jl", "./jlexamples/full_fledged_schema_examples.create_a_causalLoopDiagram.ipynb.jl", "./jlexamples/full_fledged_schema_examples.curable sexually transmitted diseases model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.diabetes model.ipynb.jl", "./jlexamples/full_fledged_schema_examples.diabetes_diagnose.ipynb.jl", "./jlexamples/full_fledged_schema_examples.sex_transmission_SIS.ipynb.jl", "./jlexamples/full_fledged_schema_examples_new.COVID_full_model.ipynb.jl", "./jlexamples/ful

TODO

KevinDCarlson commented 2 months ago

Just a remark that the “official” way to accomplish what you’re doing here is with Literate.jl, which will generate Documenter files, notebooks, and scripts from the same markdown source, if you find that shell script inconvenient to maintain at some point.