From 32bf112f2c943a45c8338b331f4c0d3cf2242c02 Mon Sep 17 00:00:00 2001 From: Wen Wei Tseng Date: Thu, 27 Jun 2024 22:42:53 +0800 Subject: [PATCH] formating --- run.jl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/run.jl b/run.jl index 1691e30..31f94c5 100644 --- a/run.jl +++ b/run.jl @@ -60,10 +60,8 @@ function list_notebooks(basedir, cachedir) shaval = read(nb, String) |> sha256 |> bytes2hex @info "Notebook $(nb): hash=$(shaval)" shafilename = joinpath(cachedir, root, splitext(file)[1] * ".sha") - # Cache hit if isfile(shafilename) && read(shafilename, String) == shaval @info "Notebook $(nb) cache hits and will not be executed." - # Cache miss else @info "Notebook $(nb) cache misses. Writing hash to $(shafilename)." mkpath(dirname(shafilename)) @@ -77,7 +75,7 @@ function list_notebooks(basedir, cachedir) end end end - return (;ipynbs, litnbs) + return (; ipynbs, litnbs) end @everywhere function run_literate(file, cachedir; rmsvg=true) @@ -90,14 +88,13 @@ end function main(; basedir=get(ENV, "DOCDIR", "docs"), - cachedir=get(ENV, "NBCACHE", ".cache"), printtable=true, - rmsvg=true - ) + cachedir=get(ENV, "NBCACHE", ".cache"), + printtable=true, rmsvg=true) mkpath(cachedir) clean_cache(cachedir) - (;ipynbs, litnbs) = list_notebooks(basedir, cachedir) + (; ipynbs, litnbs) = list_notebooks(basedir, cachedir) # Execute literate notebooks in worker process(es) ts_lit = pmap(litnbs; on_error=ex -> NaN) do nb