Module reloading/Autoreloading workflow in 0.4

293 visualitzacions
Ves al primer missatge no llegit

Cedric St-Jean

no llegida,
21 d’oct. 2015, 11:24:5021/10/15
a julia-users
I'm struggling to get a good workflow going in 0.4. The docs tell me what I can do, but not so much what I should. How does everybody work? What does your "startup code" look like? In particular:

1. Should I `push!(LOAD_PATH, ".")`, or should I include every file manually? I don't know why this behavior was removed in 0.4...

2. Inside my modules, should I `include("blah.jl")` then `using blah`?

3. How does everyone reload modules when working interactively? Do you have a big block that goes
workspace()
reload
("Blag")
using LastMain.Other_Module
and you just run it every time you change something in Blag? I don't understand workspace()'s purpose. Wiping all variables (even if saved elsewhere) is awfully drastic for interactive work.

4. Has anybody succeeded in getting Autoreload.jl to work? If I `arequire("Blag")` I get warnings that require is deprecated, and it sorta-kinda works, but if I add dependencies `arequire("Blag", depends_on=["OtherModule"])` then it seems to get in a bad state where nothing gets reloaded at all.

Thank you,

Cédric

Jonathan Malmaud

no llegida,
21 d’oct. 2015, 12:05:0821/10/15
a julia-users
Hi, I'm the author of Autoreload. 
I stopped maintaining it since I now use the great Atom Julia plugin (https://github.com/JunoLab/atom-julia-client, built by Mike Innes, who participates in this forum). Its workflow is described in https://github.com/JunoLab/atom-julia-client/blob/master/docs/workflow.md

That said, please file an issue on https://github.com/malmaud/Autoreload.jl to prod me to get it functional again. 

Christian Peel

no llegida,
21 d’oct. 2015, 16:29:5121/10/15
a julia-users
Cedric,
I have also noticed the same difficulty with the workflow; this is my largest challenge with Julia.  I am aware of Autoreload.jl, but haven't tried it out much yet.  It's good to know that Juno and the atom client are available as well.

My preference is that during development at the REPL, for  the REPL (and/or compiler?) to be smart enough to notice that any file (that has been 'included') has changed and to automatically recompile it and any dependent code.  Here's my guess as to what the process would be

> include("myfun.jl")
> fun(1,2)    # fun is defined for integer inputs in myfun.jl
# make some changes to fun.jl
> fun(1,2)
# REPL checks list of files which contain code that 'fun(1,2)' depends on,
# and parses and compiles any that have changed. I.e., it automatically
# includes myfun.jl, and recompiles.  So the REPL has to keep a mapping
# in memory between the contents of a file and the file, so that it only
# includes needed files.

Does anyone have an idea as to whether this is possible?

Jonathan Malmaud

no llegida,
21 d’oct. 2015, 16:40:3521/10/15
a julia-users,chris...@ieee.org
Within IJulia, Autoreload.jl will automatically reload any changed files that were "require"ed  before a cell is executed.

That isn't possible in the normal Julia REPL at the moment, but I have a proposal out (https://github.com/JuliaLang/julia/issues/6445) that would enable it. 

Sheehan Olver

no llegida,
21 d’oct. 2015, 17:18:1821/10/15
a julia-users
The link describing the workflow is for Juno, not atom-julia-client.  How do you do the same in Atom?

Jonathan Malmaud

no llegida,
21 d’oct. 2015, 17:19:4821/10/15
a julia...@googlegroups.com
Juno is the brand name of atom-julia-client.

Sheehan Olver

no llegida,
21 d’oct. 2015, 17:22:4321/10/15
a julia...@googlegroups.com

I thought Juno is still the brandname for the LightTable plug in.  In any case, the command “Set current module” doesn’t seem to exist for me

Cedric St-Jean

no llegida,
21 d’oct. 2015, 18:49:1521/10/15
a julia-users
Hi Jonathan,

Thank you for maintaining Autoreload and for all the pointers. It made me seriously consider Atom. Do you know if it's the future of Juno (vs. Lighttable)? How do you like it as a Jupyter notebook replacement?

I'll try to get some reproducible bug description filed.

Best,

Cédric

Jonathan Malmaud

no llegida,
22 d’oct. 2015, 21:05:3222/10/15
a julia-users
Ya, at this point it's the future of Juno. 

I still use the Jupyter notebook - I find they are useful for different things. Juno is great when I'm writing a library of reusable code or working on an existing library (such as the Julia standard library) and want to use the advanced text editing, file navigation, and searching features of Atom (my "night" job). 

Jupyter is good for when I'm using Julia to interactively do data analysis on my experiments and want to visualize results and keep the visualizations tied the block of code that generated them. In that context, I'm not really interested in the reusability and shareability of the code I'm writing, but rather in the results of the analysis and their visualizations (my "day" job). 
Respon a tots
Respon a l'autor
Reenvia
0 missatges nous