Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pmap in literate examples #190

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}()
Expand All @@ -15,21 +16,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")
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
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(
Expand All @@ -52,9 +53,9 @@ makedocs(
"Glacial Flow" => "ice_dynamics.md",
"Grigoriev Ice Cap" => "grigoriev.md",
"Budyko-Sellers-Halfar" => "budyko_sellers_halfar.md",
# "Examples" => Any[
# "examples/cfd_example.md"
# ],
"Examples" => Any[
"examples/cfd_example.md"
],
"Library Reference" => "api.md"
]
)
Expand Down
4 changes: 2 additions & 2 deletions examples/chemistry/brusselator_bounded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down