Date: Thu, 28 Mar 2024 18:04:53 +0100 (CET) Message-ID: <1647251967.3093.1711645493900@confluencesrv1.awi.de> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3092_387902512.1711645493899" ------=_Part_3092_387902512.1711645493899 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Jupyter Notebook is a web-based application for interactive work= on Jupyter Notebook documents. These documents can combine source code, th= e source code=E2=80=99s output, and additional text and images.
The system is accessible via a web browser. The Jupyter Notebook softwar= e connects a notebook document with an R or Python interpreter to allow int= eractive execution of the source code.
The software comes with preinstalled interpreters and a predefined set o= f libraries for Python 2.7, Python 3.6, and R 3.6 in a multiuser configurat= ion called Jupyterhub. These environments are named =E2=80=9CAnaconda-Pytho= n2.7=E2=80=9D, =E2=80=9CAnaconda-Python3.6=E2=80=9D, and =E2=80=9CR=E2=80= =9D.
Users cannot modify this basic set of libraries. Instead, users can crea= te their custom environments for Python 2.7 or Python 3.6, stored in the us= er=E2=80=99s home folder, and add additional libraries therein. For R, user= s can extend the basic library set by installing additional libraries in a = local package repository, also stored in the user=E2=80=99s home folder.
Central instances of the Jupyter Notebook Server are available under&nbs= p;https://jupyterhub.awi.de for all AWI users, and under https://jupyterhub.mosaic-data.org for MOSAiC. Additionally, pe= rsonal instances of Jupyterhub are available for users or workgroups on req= uest. They have a limited life span, after which they are deleted automatic= ally. As described before, custom environments remain, as they are stored i= n the user=E2=80=99s home folder and remain available in all instances of J= upyterhub at AWI.
The default user interface is the newly designed Jupyterlab UI. However,= you can switch to the old interface by clicking =E2=80=9CHelp=E2=80=9D in = the menu bar and then =E2=80=9CLaunch Classic Notebook=E2=80=9D. The old do= cumentation can be found here.
The left sidebar contains tabs for a file browser, a list of running not= ebooks and terminals, a list of open tabs, etc. It can be collapsed and exp= anded by a click on the tabs icon.
Existing notebooks can be found by the =E2=80=9Cfile browser=E2=80=9D ta= b in the left side panel (first icon) and opened by a double click. A right= -click on an item in the file browser opens a context menu for file downloa= d, copy, rename, etc.
The =E2=80=9CLauncher=E2=80=9D starts new notebook documents. It is acce= ssible either by click on =E2=80=9CFile=E2=80=9D -> =E2=80=9CNew Launche= r=E2=80=9D in the menu bar or by click on the plus-symbol in the file brows= er tab in the left side panel.
The Launcher shows an icon for a new notebook for each installed conda e= nvironment (see below). The complete name of an environment is shown when y= ou place the mouse pointer over the icon for a second.
The official Jupyterlab manual can be found at https://jupyterlab.readthedocs.io/en/stable/user/inte= rface.html
The included file browser (first icon in the left icon bar) shows = your personal home folder.
The central storage is available in folder /isibhv and includes pr= ojects (/isibhv/projects), netscratch (/isibhv/netscratch), platforms-data = (/isibhv/platforms), etc.
You can directly use those paths within your scripts and notebooks= , but the folders are not directly accessible within the file browser.
You can place a link into your home folder:
Open a =E2=80=9Cterminal=E2=80=9D and enter the following command:=
ln -s /isibhv/projects/myOwnProject ~/myProjectLink
=E2=80=9C/isibhv/projects/myOwnProject=E2=80=9D is the folder you = want to link to and =E2=80=9CmyProjectLink=E2=80=9D is the name under which= the link will appear within your home folder (indicated by the "~" symbol)= .
Whenever a kernel is attached to a notebook document, the notebook= becomes a running program and thus occupies system memory.
However, such a running notebook/program does not automatically te= rminate when you log out from the Jupyterhub or close the notebook tab. Ins= tead, you need to stop the notebook!
You can stop a running notebook by clicking =E2=80=9CFile=E2=80=9D= and =E2=80=9CClose and shutdown notebook=E2=80=9D.
The tab =E2=80=9CRunning Terminals and Kernels=E2=80=9D (second ic= on on the left icon bar) lists all running notebooks. They can also be term= inated by a click on =E2=80=9CSHUT DOWN=E2=80=9D.
Please stop all notebook= s after you are done with your work!
A notebook document needs a connected kernel/environment to be executabl= e. The active kernel is shown in the upper right corner. A click on that na= me opens a menu to change the kernel.
All input in a notebook document is organized in cells, of which differe= nt types exist:
Code cells contain (Python or R) source code, they= can be executed interactively by the selected kernel. The output is shown = below the cell.
Markdown cells contain formatted text. The formatt= ed code replaces the markdown code when the cell is executed.
Raw cells are formatted like code cells but are no= t executed.
A cell can be executed by clicking the =E2=80=9CPlay=E2=80=9D button, by= the shortcut =E2=80=9CCTRL=E2=80=9D + =E2=80=9CEnter=E2=80=9D, or by click= on an entry within the =E2=80=9CRun=E2=80=9D menu in the menu bar.
Each code cell gets a sequential number to indicate the order in which t= he cells have been executed.
The selected cell has a blue bar on the left side. In =E2= =80=9Cediting=E2=80=9D mode it also has a blue frame around it. The m= odes can be switched by the =E2=80=9CEsc=E2=80=9D and =E2=80=9CEnter=E2=80= =9D key respectively.
Several shortcuts are predefined, e.g. in the command mode:=
Up/down keys: scroll up and down the cells
In edit mode:
CTRL + Enter: Execute the cell
CTRL + SHIFT + =E2=80=9C-=E2=80=9C (minus): Split the cell at the cursor= position
Preinstalled kernels are:
Python [conda env:Anaconda-Python2.7] : Python 2.7 and a set of Anaconda= =E2=80=99s default libraries
Python [conda env:Anaconda-Python3.6] : Python 3.6 and a set of Anaconda= =E2=80=99s default libraries
R : R 3.6 and default libraries
A conda environment combines an interpreter (e.g. for Python or R) and i= nstalled libraries under an explicit name. Such an environment can be avail= able centrally on a server, which makes it available for all users of that = system, or locally in the user=E2=80=99s home folder. Centrally stored envi= ronments are read-only. You can use them, but you cannot add or change libr= aries. If you need further libraries or specific library versions, you need= to create a custom environment in your home folder.
The graphical package manager is started by clicking =E2=80=9CSettings= =E2=80=9D -> =E2=80=9CConda Packages Manager=E2=80=9D in the menu bar.= p>
Here you can create, update, delete, export, and import custom environme= nts.
Please note: The centrally stored, shared environments are also listed, = but cannot be modified!
Conda paths need to be set once by the following command:
/opt/miniconda3/bin/conda init
You can change the active environment with the command =E2=80=9Econda ac= tivate=E2=80=9C. Python=E2=80=99s package manager pip always refers to the = activated environment. Conda package manager refers to the activated enviro= nment, except you specify another one by the =E2=80=93n flag.
conda env create -n envName ipykernel
conda activate -n envName=
conda install library1 library2 (=E2=80=A6)
conda activate myEnv
conda env export > myEnv.yaml
conda env create =E2=80=93f myEnv.yaml
conda install library1 =E2=80=93n myEnv
Or
conda activate myEnv
conda install library1
If you use Pip, please activate the environment first:
conda activate myEnv
pip install library1