-
Notifications
You must be signed in to change notification settings - Fork 0
Home
News: Minimal working set released on all repositories
Following assumes that you have installed Julia on your computer as recommended here.
We have not registered our package with Julia registry yet, thus adding packages in the standard way of using Pkg; Pkg.add("SD4SOLPS"
would not work yet. Here is how you can get started on using the repositories in this project right now:
You can create a test environment file on your local machine and move it around wherever you like or refer to them from where you are running scripts or jupyter notebook. But to get there, you will have to strictly follow the following steps:
- Pull all the repositories from the latest master branches.
- Some repositories have dev as the default branch, please checkout to master for stability.
- You can pull the repositories anywhere on your computer, we will be using absolute path to these repositories in the next steps.
% git pull [email protected]:ProjectTorreyPines/SD4SOLPS.jl.git
% git checkout master
- Please pull OMAS.jl, SOLPS2IMAS.jl, GGDUtils.jl, SD4SOLPS.jl, and SynthDiag.jl.
- Create a test environment directory
- This is strictly not required but will keep it clean for you.
% mkdir SD4SOLPS_env
% cd SD4SOLPS_env
- Run Julia and do the following:
% julia --project=./
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.2 (2023-07-05)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> ]
(SD4SOLPS_env) pkg> dev /Users/gupta/Git/ProjectTorreyPines/OMAS.jl
...
(SD4SOLPS_env) pkg> dev /Users/gupta/Git/ProjectTorreyPines/SOLPS2IMAS.jl
...
(SD4SOLPS_env) pkg> dev /Users/gupta/Git/ProjectTorreyPines/GGDUtils.jl
...
(SD4SOLPS_env) pkg> dev /Users/gupta/Git/ProjectTorreyPines/SD4SOLPS.jl
...
(SD4SOLPS_env) pkg> dev /Users/gupta/Git/ProjectTorreyPines/SynthDiag.jl
...
(SD4SOLPS_env) instantiate
(SD4SOLPS_env) # press backspace (delete on mac) to get out
julia> exit()
- Use your local paths to the pulled repos above.
- Note that you can use
add
instead ofdev
above butdev
allows you to remain up to date on these repos in the future by simply pulling the latest releases.
- Now to run some script using your environment, you can run the scripts as:
% julia --project=/path/to/SD4SOLPS_env/as/created/above/ some_script.jl
- Or you can run a jupyter notebook (for this to work, you'll have to install IJulia package in your main environment, then select the Julia kernel after starting the notebook or opening it in VScode), and at the top cell:
using Pkg;
Pkg.activate("./")
Pkg.instantiate()
- You can also make copies of the
Project.toml
andManifest.toml
generated in yourSD4SOLPS_env
directory and pass it around to any other directory in your local machine. In that case, it will become easier to call the scripts:
% cd working_dir
% cp /path/to/SD4SOLPS_env/as/created/above/*.toml ./
% julia --project some_script.jl
If you do not care to look often into the source code, you can skip the step of pulling the git repos yourself and let julia package manager do it for you. In this case, you will skip step 1 above, follow step 2, and on step 3, do this instead:
- Run Julia and do the following:
% julia --project=./
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.2 (2023-07-05)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> ]
(SD4SOLPS_env) pkg> add "[email protected]:ProjectTorreyPines/OMAS.jl.git"#master
...
(SD4SOLPS_env) pkg> add "[email protected]:ProjectTorreyPines/SOLPS2IMAS.jl"#master
...
(SD4SOLPS_env) pkg> add "[email protected]:ProjectTorreyPines/GGDUtils.jl"#master
...
(SD4SOLPS_env) pkg> add "[email protected]:ProjectTorreyPines/SD4SOLPS.jl"#master
...
(SD4SOLPS_env) pkg> add "[email protected]:ProjectTorreyPines/SynthDiag.jl"#master
...
(SD4SOLPS_env) instantiate
(SD4SOLPS_env) # press backspace (delete on mac) to get out
julia> exit()
You can follow the rest of the steps as above. For updating any package in future, you'll have to run following:
cd SD4SOLPS_env # where Project.toml and Manifest.toml are stored
% julia --project=./
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.2 (2023-07-05)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> ]
(SD4SOLPS_env) pkg> update OMAS
...
Note: The packages have following dependence order right now, you'll have to ensure that this is not broken while installing and updating packages:
SynthDiag -> SD4SOLPS -> GGDUtils -> SOLPS2IMAS -> OMAS