From b793d4d0e92a0dcb0790c88e5f9c759e24656c83 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 25 Jan 2024 11:39:47 -0500 Subject: [PATCH 1/3] use pmap in literate examples --- docs/make.jl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index f8262eb4..8ad73297 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -15,21 +15,21 @@ if !(haskey(ENV, "GITHUB_ACTIONS") || haskey(ENV, "GITLAB_CI")) config["repo_root_url"] = "https://github.com/AlgebraicJulia/Decapodes.jl/blob/main/docs" end -#const literate_dir = joinpath(@__DIR__, "..", "examples") -#const generated_dir = joinpath(@__DIR__, "src", "examples") -# -#for (root, dirs, files) in walkdir(literate_dir) -# out_dir = joinpath(generated_dir, relpath(root, literate_dir)) -# for file in files -# f,l = splitext(file) -# if l == ".jl" && !startswith(f, "_") -# Literate.markdown(joinpath(root, file), out_dir; -# config=config, documenter=true, credit=false) -# Literate.notebook(joinpath(root, file), out_dir; -# execute=true, documenter=true, credit=false) -# end -# end -#end +const literate_dir = joinpath(@__DIR__, "..", "examples") +const generated_dir = joinpath(@__DIR__, "src", "examples") + +for (root, dirs, files) in walkdir(literate_dir) + out_dir = joinpath(generated_dir, relpath(root, literate_dir)) + pmap(files) do file + f,l = splitext(file) + if l == ".jl" && !startswith(f, "_") + Literate.markdown(joinpath(root, file), out_dir; + config=config, documenter=true, credit=false) + Literate.notebook(joinpath(root, file), out_dir; + execute=true, documenter=true, credit=false) + end + end +end @info "Building Documenter.jl docs" makedocs( From 1fb01bbbba535818df9742d37d92d8439e243112 Mon Sep 17 00:00:00 2001 From: "James P. Fairbanks" Date: Mon, 26 Feb 2024 16:07:19 -0600 Subject: [PATCH 2/3] reduce runtime of brusselator_bounded.jl example --- examples/chemistry/brusselator_bounded.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chemistry/brusselator_bounded.jl b/examples/chemistry/brusselator_bounded.jl index b2cf3910..4b72fb0a 100644 --- a/examples/chemistry/brusselator_bounded.jl +++ b/examples/chemistry/brusselator_bounded.jl @@ -65,7 +65,7 @@ resolve_overloads!(Brusselator) to_graphviz(Brusselator) # TODO: Create square domain of approximately 32x32 vertices. -s = loadmesh(Rectangle_30x10()) +s = triangulated_grid(30,10,2,2) scaling_mat = Diagonal([1/maximum(x->x[1], s[:point]), 1/maximum(x->x[2], s[:point]), 1.0]) @@ -230,7 +230,7 @@ constants_and_parameters = ( R = R, F = t -> t ≥ 1.1 ? F₂ : F₁) -tₑ = 21.5e4 +tₑ = 21.5e2 @info("Precompiling Solver") prob = ODEProblem(fₘ, u₀, (0, 1e-4), constants_and_parameters) From fba9e1db1ebc00c9c0064dafc2396628bba9c5b6 Mon Sep 17 00:00:00 2001 From: Luke Morris <70283489+lukem12345@users.noreply.github.com> Date: Sun, 10 Mar 2024 12:54:11 -0400 Subject: [PATCH 3/3] Define pmap --- docs/make.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/make.jl b/docs/make.jl index 4a71b3b6..85738643 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -7,6 +7,7 @@ using Catlab using Catlab.WiringDiagrams using AlgebraicPetri using CairoMakie +using Distributed # Set Literate.jl config if not being compiled on recognized service. config = Dict{String,String}()