SciML / Catalyst.jl

Chemical reaction network and systems biology interface for scientific machine learning (SciML). High performance, GPU-parallelized, and O(1) solvers in open source software.
https://docs.sciml.ai/Catalyst/stable/
Other
460 stars 77 forks source link

Added docs and assets for interactive simulation plotting tutorial #1053

Open jonathanfischer97 opened 2 weeks ago

jonathanfischer97 commented 2 weeks ago

Added tutorial on how to simulate and plot a Catalyst.jl generated ODEProblem using GLMakie.jl.

Additional embedded assets are SVG screenshots and an mp4 demoing the full interactive window.

image image (1) image (2) image (3)

TorkelE commented 1 week ago

This looks really nice! I think my main comment is that it would be nice to run as much of the docs as possible dynamically, e.g. by using

'''@example dynamic_brusselator_example
# code
'''

rather than

'''julia
# code
'''

(see rest of docs)

That way, if there is an error in the code (of if an error is produced later on due to package updates) that is caught. I imagine this will become problems for the code doing the interactivity stuff, but some code blocks should be possible to make this way.

jonathanfischer97 commented 1 week ago

Made all the requested suggestions, including dynamically building the plot from the code blocks!

The reason I didn't do this originally is because GLMakie displays the frame buffer in a separate window, so I wasn't sure how this would be displayed as an embedded plot in the HTML. But it seems there are arguments to plot inline and prevent the window, so I added that as a hidden line in the example code.

The last code block doesn't display the dynamically generated figure because I have the mp4 of the interaction instead

jonathanfischer97 commented 1 day ago

Looks like some tests and the documentation build weren't successful. This is the first time I've PRed docs, do I need to fix anything on my end?

isaacsas commented 1 day ago

There are some issues with the Catalyst tests currently. @TorkelE is fixing them in https://github.com/SciML/Catalyst.jl/pull/1070

Once that gets merged if you merge master into your local pr branch and then push it to Github that should hopefully allow your tests to go through here.

isaacsas commented 1 day ago

(I usually use Gitkraken for such things as you can just drag master onto your local branch and tell it to merge master into your branch.)

TorkelE commented 18 hours ago

There is something really weird going on with SI, possibly weirdest thing I've encountered. Currently faller quite sick, and don't think I will be able to do anything the next few days. I have disabled SI in the test fix PR. Please feel free to merge if we want to go ahead making updates without SI (ok for me).

isaacsas commented 11 hours ago

@TorkelE no worries -- I hope you feel better soon!