From 3e5726b31af9d1b970ec302d55785d1684a95457 Mon Sep 17 00:00:00 2001
From: Michael Blaschek <michael.blaschek@univie.ac.at>
Date: Tue, 24 Nov 2020 16:06:23 +0100
Subject: [PATCH] Upload New File

---
 Python/QA-002-Modules-loaded-Kernel.ipynb | 141 ++++++++++++++++++++++
 1 file changed, 141 insertions(+)
 create mode 100644 Python/QA-002-Modules-loaded-Kernel.ipynb

diff --git a/Python/QA-002-Modules-loaded-Kernel.ipynb b/Python/QA-002-Modules-loaded-Kernel.ipynb
new file mode 100644
index 0000000..f80b8f8
--- /dev/null
+++ b/Python/QA-002-Modules-loaded-Kernel.ipynb
@@ -0,0 +1,141 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Loading Modules into the Kernel (Notebook) environment"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Check what modules are currently loaded in this Notebook session"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Currently Loaded Modulefiles:\n",
+      " 1) miniconda3/4.8.2-gcc-8.3.1-3m7b6t2  \n"
+     ]
+    }
+   ],
+   "source": [
+    "!module list --no-pager"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Put this file `load_modules_into_jupyter.conf` into your Home directory and your Notebook environment will have these modules loaded.\n",
+    "It is not possible to load these modules via magic (python magic ;).\n",
+    "\n",
+    "\n",
+    "**It needs the empty line at the end...**"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Writing /jetfs/home/mblaschek/load_modules_into_jupyter.conf\n"
+     ]
+    }
+   ],
+   "source": [
+    "%%writefile ~/load_modules_into_jupyter.conf\n",
+    "eccodes/2.18.0-gcc-8.3.1-s7clum3\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "eccodes/2.18.0-gcc-8.3.1-s7clum3\n"
+     ]
+    }
+   ],
+   "source": [
+    "!cat ~/load_modules_into_jupyter.conf"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Restart the kernel and you should see that the module is loaded"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Currently Loaded Modulefiles:\n",
+      " 1) miniconda3/4.8.2-gcc-8.3.1-3m7b6t2        \n",
+      " 2) zlib/1.2.11-gcc-8.3.1-bbbpnzp             \n",
+      " 3) openmpi/4.0.5-gcc-8.3.1-773ztsv           \n",
+      " 4) hdf5/1.12.0-gcc-8.3.1-awl4atl             \n",
+      " 5) parallel-netcdf/1.12.1-gcc-8.3.1-xxrhtxn  \n",
+      " 6) netcdf-c/4.7.4-gcc-8.3.1-fh4nn6k          \n",
+      " 7) eccodes/2.18.0-gcc-8.3.1-s7clum3          \n"
+     ]
+    }
+   ],
+   "source": [
+    "!module list --no-pager"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Now all the dependencies are loaded as well"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Miniconda3 (4.8.2)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.8.1"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 4
+}
-- 
GitLab