Turkie.jl icon indicating copy to clipboard operation
Turkie.jl copied to clipboard

Turkie in Pluto

Open eford opened this issue 3 years ago • 6 comments

Very nice idea. I tried the README's small example in Pluto (both as written and using WGLMakie instead of GLMakie). It opened a new browser tab that stayed empty until the chain was done. If I clicked reload, then it would show the final plot. If I called sample a second time, then the plots in the other browser tab would update. However, it was ~10x slower than running the sampler without the callback.
Are these a known limitations? Or am I misusing Turkie?

eford avatar Aug 15 '21 13:08 eford

I never tried in Pluto, but I think it should just work out of the box. Since a new browser tab it sounds like there might be some issue with the output of the figure, I am honestly not sure how it should work with interactions... What you could try is to display the TurkieCallback object in a separate cell and see what happens...

theogf avatar Aug 18 '21 09:08 theogf

I found that if I just place

cb.figure

in a separate cell, I do get a full chart. It does not update as the sampler updates as an online plot, but is a static plot of the results. Still, it's quite useful -- thanks for the package! I'm not sure how one could coordinate the interactivity between Pluto and the online plotting here, but I imagine something from http://juliaplots.org/WGLMakie.jl/stable/ might work.

ianfiske avatar Dec 16 '21 17:12 ianfiske

Maybe @fonsp knows more about interactions between Makie and Pluto especially with Observables

theogf avatar Dec 16 '21 17:12 theogf

They don't really interact right now because the two paradigms don't fit together easily. There might be a possibility to link Observables into Pluto's model using https://github.com/JuliaPluto/PlutoHooks.jl, but the main problem to solve first is stability of WGLMakie inside Pluto.

fonsp avatar Dec 17 '21 23:12 fonsp

Rendering to a video and displaying it with PlutoUI.LocalResource might be the easiest way to get it working inside Pluto :)

fonsp avatar Dec 17 '21 23:12 fonsp

The motivation is that we want to be able to visualize the current state of a long-running calculation, so we can interrupt it if we realize it's not going to end well or decide to go to sleep if we can tell it will need at least a few more hours to finish. So waiting until the calculation is done and making a movie wouldn't achieve the goal.

On Fri, Dec 17, 2021 at 6:52 PM Fons van der Plas @.***> wrote:

Rendering to a video and displaying it with PlutoUI.LocalResource might be the easiest way to get it working inside Pluto :)

— Reply to this email directly, view it on GitHub https://github.com/theogf/Turkie.jl/issues/38#issuecomment-997096214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKDFQWQJEYYZV2MGMANUBLURPEMHANCNFSM5CGFMW2Q . You are receiving this because you authored the thread.Message ID: @.***>

-- Eric Ford

eford avatar Dec 18 '21 00:12 eford