I write the code on two different machines and I also want to be able to run it on different machines. To have as little differences in julia on the different machines as possible I would like to use the same environment.
Now, my idea was to activate a project in the root folder and then add `Pkg.activate(“path/to/root”) in each script. (I run the scripts from different levels of the directory tree separately).
I usually have the following directory layout for research code:
.
|--- paper
|
|--- ... other languages, eg stata, R
|
|--- slides
|
|--- ...
|
|--- julia
|
|- Project.toml
|- src/ProjectModule.jl
|- test/...
|- scripts/...
...
ie with a single module, which contains a
"""
$SIGNATURES
Root path of the project. Useful for organizing results, plots, data, etc.
"""
project_path(parts...) = normpath(joinpath(@__DIR__, "..", parts...))
or similar for relative paths.
I only activate the ./julia/ directory for the project.
Having multiple modules is tricky AFAIK. I use submodules.