fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.92k stars 284 forks source link

Can Pluto.jl & Revise.jl work together? #238

Closed jarvist closed 3 years ago

jarvist commented 3 years ago

I'm a computational scientist, so I often have a workflow where I'm simultaneously writing a Julia package, and then using a notebook to run experiments & make plots as I change stuff. Using Tim Holy's Revise.jl is really useful here, as you can edit functions & all it just works. In a Jupyter notebook, this workflow requires a first cell something like:

using Revise
using Pkg
Pkg.activate("../")
using MyPackage

However, this doesn't seem to work in Pluto. It doesn't give any errors, but also Revise.jl does not automatically update. Instead you have to shut down & restart the kernel as you make edits. Am I doing something wrong, or is there some fundamental incompatibility with Revise.jl?

fonsp commented 3 years ago

Thanks for the suggestion, I agree that it would be very useful! I am considering enabling Revise by default, and doing the same from include: #78 and https://github.com/fonsp/Pluto.jl/issues/115#issuecomment-661405264

I'll come back to this later :)

jarvist commented 3 years ago

Great! I think Revise (or equivalent) and Pluto would be very natural to use together.

lungben commented 3 years ago

I am very much in favor of it, it would have saved me quite some time yesterday ;-)

Should Revise be executed on the Pluto server side, e.g.

using Revise
using Pluto
Pluto.run(1234)

or in the notebooks?

Probably both are fine from user perpective.

fonsp commented 3 years ago

416

jarvist commented 3 years ago

Fantastic!

fonsp commented 3 years ago

Done! You need Revise 2.7.6 or 3.0.0 and Pluto 0.12.0 (not released yet) 🙂