Numba
Making your Python code run faster with numba: from simple to advanced examples.
Tutorial
The tutorial Jupyter notebook can be found here: numba_tutorial.ipynb
.
Setup
To follow along, you should have number, jupyter, python, and scipy installed. These are present in the latest Anaconda distribution, which in turn is available on Kapteyn machines, or on Kapteyn JupyterHub.
Kapteyn JupyterHub
Go to https://jupyterhub.astro.rug.nl/ and log in. Done!
Kapteyn workstation
If you’re behind a Kapteyn workstation, fire up a Jupyter notebook with:
$ module load anaconda3/2019.10
$ jupyter lab
Remote connection to Kapteyn
Or if you’re on a laptop but do not want to install anything, you can do:
$ ssh -L localhost:8888:localhost:8888 -t <username>@kapteyn.astro.rug.nl \
ssh -L localhost:8888:localhost:8888 <workstation>
$ module load anaconda3/2019.10
$ jupyter lab --no-browser
And open up http://localhost:8888 in your browser.
Tip: look at the ssh how-to on how to simplify the first command.
Local conda installation
Lastly, if you already have conda installed but not the full Anaconda installation, you can do:
$ conda create -n numba-env numba python jupyterlab scipy
$ conda activate numba-env
$ jupyter lab