Using Julia

Setting up Julia to work with the EpiAware packages.

This guide helps you set up Julia to work with the EpiAware packages, whether you are analysing data or contributing code. It assumes you are comfortable with another technical computing language (R, Python, MATLAB) but new to Julia.

It is not a guide to learning Julia. To learn the language, start with:

Install Julia

Install with juliaup, which manages Julia versions for you. Follow the instructions for your platform, then check it works:

julia --version

Set up an editor

VS Code with the Julia extension is the most common setup. It gives you an integrated REPL, a test explorer, a debugger, a plot viewer, and symbol navigation.

Environments

Julia uses per-project environments defined by a Project.toml and Manifest.toml. In the REPL, press ] to enter the package manager, then:

activate .        # use the environment in the current directory
instantiate       # install the exact versions from the manifest
add CensoredDistributions

An activate --temp environment is handy for throwaway experiments.

A productive REPL

A few global packages make interactive work smoother:

using Pkg
Pkg.add(["Revise", "OhMyREPL", "BenchmarkTools", "TestEnv"])

Load them automatically by adding a ~/.julia/config/startup.jl:

atreplinit() do repl
    try
        @eval using Revise
        @eval using OhMyREPL
    catch e
        @warn "startup.jl" exception = (e, catch_backtrace())
    end
end

Revise.jl reflects your code changes without restarting Julia — essential for development.

Getting help

Next: the FAQ, or dive into the packages.