-
Install Julia from the official website: https://julialang.org/downloads/
- Download the current stable release (e.g., Julia 1.11.x) for your operating system.
- Run the installer and finish setup.
-
Install Julia Extension in VS Code
- Open VS Code.
- Go to the Extensions Marketplace (left sidebar, square icon).
- Search for "Julia" and install the official extension by julialang.
- Clone the repository from GitHub (or unzip if shared as a folder).
or just copy the folder.
git clone <repo-url>
- Fetch any reference papers not tracked in git:
This reads every
bash scripts/fetch_resources.sh
resources/MANIFEST.txtin the repo and downloads whatever listed file is missing locally. Safe to re-run any time — files already present are left alone. Report any[MISSING, no url given]lines to whoever maintains that folder. - In VS Code, click File → Open Folder… and select the MultiPeriodDistOPF folder.
From the terminal in VS Code, start Julia in project mode:
julia --project=.Then in the Julia REPL (prompt looks like julia>), run:
using Pkg
Pkg.instantiate()This downloads and installs all packages listed in Project.toml and Manifest.toml. Only needs to be done once (unless dependencies change later).
To make running scripts easier, environment activation can be done inside the script itself.
For example, at the top of main.jl (which lives in the repo root), add:
import Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()Pkg.activate(@__DIR__)ensures the environment in the repo root is used.Pkg.instantiate()ensures dependencies are installed if missing.- This allows running the script directly with:
without needing to manually activate the environment each time.
julia main.jl
If the script is located in a subfolder (e.g., src/), use:
Pkg.activate(joinpath(@__DIR__, ".."))Run any of the scripts in the repo, for example:
include("main.jl")or
include("admm_temporal_copper_plate.jl")Every time Julia restarts, either:
- Start Julia with the project environment:
julia --project=.
- Or just run a script that has the activation snippet included at the top.
- If VS Code asks to choose a Julia environment, select the MultiPeriodDistOPF folder.
- If issues occur, delete Manifest.toml and run
Pkg.instantiate()again. - To keep all dependencies inside this repo instead of the global Julia folder, set
JULIA_DEPOT_PATH=$PWD/.julia_depotbefore running Julia.