*** Interfacing with Julia ***
JIT compilation proposes "explorational" workflow
Thus, we need ways to:
.juliarc.jl
¶On startup, Julia loads .juliarc.jl
from home directory
We can load project-specific initialization:
# ~\.juliarc.jl
# Include the other .juliarc.jl at the given dir
function loadrc(dir::AbstractString)
if (dir != ENV["HOME"] && dir != "/")
juliarc = joinpath(dir, ".juliarc.jl")
if isfile(juliarc)
println("Including ", juliarc)
include(juliarc)
end
end
end
# include .juliarc.jl at startup wd
loadrc(pwd())
# In my Jupyter notebook this already happened:
loadrc
loadrc (generic function with 1 method)
# .juliarc.jl at project directory
println("Using modules...")
using JuMP
using Gadfly
# ...
println("Importing custom modules...")
push!(LOAD_PATH, pwd()*"/opt") # dirs of modules
push!(LOAD_PATH, pwd()*"/obj")
import JumpLP # only imported modules can be reloaded
import MyLP
import Svm
# ...
# ease reloading
reload(name::AbstractString) = Base.reload(name)
function reload() # all at once
reload("JumpLP")
reload("MyLP")
reload("Svm")
# ...
end
reload() # after changing some WIP module
WARNING: replacing module JumpLP WARNING: replacing module MyLP WARNING: replacing module Svm