1
python overview
Sven Augustin edited this page 2025-06-12 15:34:08 +02:00

Analysis

(Note: The following lines can be added to ~/.bashrc to automatically load the environment when logging in.)

  • Source Maloja conda installation (Python 3.9):
source /sf/maloja/applications/miniconda3/etc/profile.d/conda.sh
  • Activate Maloja Analysis conda environment:
conda activate mana

Currently, the environment contains the following packages (and their dependencies):

as well as numpy, scipy, matplotlib, jupyter, etc.

Setup on Ra/Jupytera

Automatic Way

A script that automates the setup on Ra can be found in /sf/maloja/bin/. It expects a pgroup as argument:

/sf/maloja/bin/ra_setup.sh p12345

(Replace p12345 with the correct pgroup.)

Manual Way

In order to access the above environment on jupytera run

conda config --add envs_dirs /sf/maloja/applications/miniconda3/envs

in a terminal within jupytera.

The top-most directory you can see in jupytera is your home folder. To be able to see the data folders, you can create a symlink:

cd && ln -s /sf/maloja/data/p12345

(Replace p12345 with the correct pgroup.)

DAQ

  • As gac-maloja, the Maloja DAQ environment can be activated via:
conda activate mdaq

Currently, the environment contains the following packages (and their dependencies):

Jupytera via hop

To create an ssh tunnel from your local computer to jupytera, insert your user name here

user="familyname_initial"; ssh -J $user@hop.psi.ch $user@ra.psi.ch -L 5000:jupytera.psi.ch:443

then run the command. You will be asked your password twice (once for hop, once for Ra). Afterwards, connect to https://localhost:5000/hub/login in your local browser. You will see a certificate warning due to the address now being localhost.

Instead of the command above, you can also download and use this script.

Setup:

curl https://gitlab.psi.ch/maloja/docs/-/wikis/uploads/fbf870b995bff343f14e429c21f4925d/tunnel2jupytera.sh
chmod +x tunnel2jupytera.sh

Run:

./tunnel2jupytera.sh -u familyname_initial

Usage:

Check for the available options via

tunnel2jupytera.sh -h