Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into autodiff-gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Aug 11, 2023
2 parents c58019d + a63d855 commit b5aed2d
Show file tree
Hide file tree
Showing 6 changed files with 515 additions and 250 deletions.
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@
"isort",
"jacrev",
"jaxlib",
"joinpath",
"juliaup",
"jupyterlab",
"kernelspec",
"kutschke",
Expand Down
6 changes: 3 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ build:
jobs:
post_install:
- |
wget https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.3-linux-x86_64.tar.gz
- tar xzf julia-1.7.3-linux-x86_64.tar.gz
wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.2-linux-x86_64.tar.gz
- tar xzf julia-1.9.2-linux-x86_64.tar.gz
- mkdir bin
- ln -s $PWD/julia-1.7.3/bin/julia bin/julia
- ln -s $PWD/julia-1.9.2/bin/julia bin/julia
- ./bin/julia docs/InstallIJulia.jl
- pip install -e .[doc] -c .constraints/py3.8.txt
68 changes: 49 additions & 19 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,31 +258,49 @@ In that case, trash the virtual environment and
Physics. While ComPWA is mainly developed in Python, we try to taylor to new trends and
are experimenting with Julia as well.

Julia can be downloaded [here](https://julialang.org/downloads). To install Julia in
Linux and Mac, you'll have to unpack the downloaded
Julia can be downloaded [here](https://julialang.org/downloads) or can be installed
within your virtual environment with [juliaup](https://github.com/JuliaLang/juliaup). To
install Julia system-wide in Linux and Mac, you'll have to unpack the downloaded
[tar](<https://en.wikipedia.org/wiki/Tar_(computing)>) file to a location that is easily
accessible. Here's an example, where we also make the Julia executable available to the
system:

::::{tab-set}
:::{tab-item} System-wide installation
:::::{tab-set}
::::{tab-item} Conda

Install [juliaup](https://github.com/JuliaLang/juliaup) for installing and managing
Julia versions.

```shell
cd ~/Downloads
tar xzf julia-1.7.3-linux-x86_64.tar.gz
sudo mv julia-1.7.3 /opt/
sudo ln -s /opt/julia-1.7.3/bin/julia /usr/local/bin/julia
conda install juliaup -c conda-forge
```

:::{dropdown} Optional: select Julia version
By default, this provides you with the latest Julia release. **Optionally**, you can
switch versions as follows:

```shell
conda install juliaup -c conda-forge
juliaup add 1.9
juliaup default 1.9
```

You can switch back to the latest version with:

```shell
juliaup default release
```

:::
:::{tab-item} Home-folder installation
::::
::::{tab-item} Home-folder

```shell
cd ~/Downloads
tar xzf julia-1.7.3-linux-x86_64.tar.gz
tar xzf julia-1.9.2-linux-x86_64.tar.gz
mkdir ~/opt ~/bin
mv julia-1.7.3 ~/opt/
ln -s ~/opt/julia-1.7.3/bin/julia ~/bin/julia
mv julia-1.9.2 ~/opt/
ln -s ~/opt/julia-1.9.2/bin/julia ~/bin/julia
```

Make sure that `~/bin` is listed in the `PATH` environment variable, e.g. by updating it
Expand All @@ -292,8 +310,18 @@ through your `.bashrc` file:
export PATH="~/bin:$PATH"
```

:::
::::
::::{tab-item} System-wide

```shell
cd ~/Downloads
tar xzf julia-1.9.2-linux-x86_64.tar.gz
sudo mv julia-1.9.2 /opt/
sudo ln -s /opt/julia-1.9.2/bin/julia /usr/local/bin/julia
```

::::
:::::

Just as in Python, it's safest to work with a
{ref}`virtual environment <develop:Virtual environment>`. You can read more about Julia
Expand Down Expand Up @@ -599,8 +627,7 @@ which is automatically

It's also possible to execute and render Jupyter notebooks with Julia kernels. For this,
{ref}`install Julia<develop:Julia>` and install
[IJulia](https://julialang.github.io/IJulia.jl) _system-wide_ (not in a virtual
environment):
[IJulia](https://julialang.github.io/IJulia.jl):

::::{tab-set}
:::{tab-item} Shell
Expand All @@ -620,7 +647,8 @@ Pkg.add("IJulia")
:::
::::

Next, install a Jupyter kernel:
Usually, this also installs a Jupyter kernel directly. **Optionally**, you can define a
Jupyter kernel manually:

<!-- cspell:ignore installkernel -->

Expand All @@ -643,10 +671,12 @@ installkernel("julia")
::::

and select it as kernel in the Jupyter notebook.

:::{note}
IJulia has to be installed system-wide to make Sphinx understand how to execute the
notebook. You can however access the local environment from the notebook itself, e.g. by
defining a cell:
As mentioned in {ref}`develop:Julia`, Julia can be installed within your Conda
environment through [`juliaup`](https://anaconda.org/conda-forge/juliaup). This is,
however, not yet a virtual environment for Julia itself. You can create a virtual
environment for Julia itself by for instance defining it through a code cell like this:

```julia
using Pkg
Expand Down
8 changes: 4 additions & 4 deletions docs/report/019.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"outputs": [],
"source": [
"using Pkg\n",
"Pkg.activate(\"019\")\n",
"Pkg.activate(joinpath(@__DIR__, \"019\"))\n",
"Pkg.instantiate()"
]
},
Expand Down Expand Up @@ -165,15 +165,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "julia 1.7.3",
"display_name": "Julia 1.9.2",
"language": "julia",
"name": "julia-1.7"
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.3"
"version": "1.9.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit b5aed2d

Please sign in to comment.