-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error converting examples/extra/heisenberg_animation.jl into a Jupyter notebook #347
Comments
To summarize, I think the concrete issue is that the Julia code using WGLMakie
[...]
record(fig, "animation.mp4", 1:500; framerate=30) do _
for _ in 1:5
step!(sys, integrator)
end
notify(fig)
end doesn't correctly execute in the Literate notebook generator? In the current CI, we are generating notebooks with |
I walked through the examples directory and generated notebooks for every .jl file. using Literate
using Sunny
function pp_vcheck(str)
check = "@assert pkgversion(Sunny) >= " * repr(pkgversion(Sunny))
return replace(str, r"^(using.*Sunny.*)$"m => SubstitutionString("\\1\n"*check))
end
function pp_wglmakie(str)
return replace(str, r"^using(.*?)GLMakie"m => s"using\1WGLMakie")
return str
end
for (root, dirs, files) in walkdir("examples")
println("Files in $root")
for file in files
if(splitext(file)[2] == ".jl")
println(joinpath(root, file)) # path to files
Literate.notebook(joinpath(root, file), root, preprocess=pp_wglmakie∘pp_vcheck, execute=true, credit=false)
end
end
end The simplest fix will be excluding the examples/extra directory in the above script. Not sure if this is of interest to Makie or Literate. Some way of skipping execution of a single cell would be sufficient. |
OK, this seems like an issue with Makie or Literate, so I'm closing it here. |
I tried converting the example file
examples/extra/heisenberg_animation.jl
to a Jupyter notebook using the following script.and get the following error from WGLMakie
If I remove
pp_wglmakie
the script finishes without errors. Also, I can run examples/extra/heisenberg_animation.jl with WGLMakie with the animation being displayed in a Chrome tab.The text was updated successfully, but these errors were encountered: