-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Users often want to use Jupyter notebooks to run AiiDA calculations or perform analysis. It's possible to install jupyterlab in the Python environment where AiiDA is installed, but there are advantages to having one centralised Jupyter server running that can access all aiida-project environments:
- Only one active server needed, using less memory and other resources.
- Only have to configure the server once.
- Having access to all AiiDA projects is useful in case there is interaction between the projects.
IDE's like VSCode can make this really simple as well, but often also use quite a bit of resources to make this happen. Some tools like jupytext for writing notebooks in Markdown are also not supported quite as well in VSCode.
Typically you can install a kernel of a certain environment quite easily, see:
https://ipython.readthedocs.io/en/latest/install/kernel_install.html
However, to use a separated environment for AiiDA properly, You also have to set the env key in the kernel.json, e.g.:
{
"argv": [
"/home/aiida/.virtualenvs/aiida-super/bin/python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "aiida-super",
"language": "python",
"env": {"AIIDA_PATH": "/home/aiida/envs/aiida-super"}
}
Moreover, providing a user-friendly CLI for doing these kind of kernel installs will also make the process less painful and error-prone.