I am extremely frustrated by my current workflow. There has to be a better way and I wanted to ask for advice.
Here is how I have been working. I use Dr. Watson for all of my projects. I write all my store all my source code in the /src dir of the project and will test and implement new features/debug in a .jl file in the scripts directory.
I write code in a .jl file and run them one by one in the REPL which works well. The problem comes when I am trying to debug/modify code I have already written in an src file. In order to load the changes to a file I have to restart the REPL which means I have to reimport all my packages. This process can take upwards of 30 seconds every time I want to change anything.
I have tried using Infiltrator but It seems to work sporadically. It won’t always activate when it hits a @infiltrator macro and will close the REPL if an error is encountered.
What I really want is an equivalent of the Ipython autoreload.
There seem to be lots of options like AutoReload.jl but I can seem to get them to work.
I also tried to use Pluto as I read it automatically included changes but I could not get it to work with DrWatson.
It seems like this must be a very common problem. Is there an easy way around it?
Also, what problems did you have with Pluto and DrWatson?
I think it just work provided you don’t use Pluto’s package managing. So the first cell should always be.
begin
import Pkg
Pkg.activate("path/to/your/environment")
using DrWatson
end
Or something similar.
P.s. Yes, autoreload.jl seems to be a very old package so I would not expect it to work. The usual method is Revise.jl, which is even recommended in the Julia documentation
Hi,
I had the same issues as you.
What I do now is making a module in the src folder which has the same name as the project. All my source files are included in that module.
With pluto I don’t know, but with normal script files in the script folder, all my script files start with
using DrWatson
@quickactivate :MyProjectName
With Revise.jl I can then load my script files simply with
Includet(“scripts/scriptfile.jl”) (note the t in includet)
I can then freely modify the contents of my script.jl and the main module without having to restart the repl.