diff --git a/001-Jupyter/.ipynb_checkpoints/Create_JupyterKernel_conda-checkpoint.ipynb b/001-Jupyter/.ipynb_checkpoints/Create_JupyterKernel_conda-checkpoint.ipynb deleted file mode 100644 index 309c0c8c5cfaee5597aab23be4acd563384bc126..0000000000000000000000000000000000000000 --- a/001-Jupyter/.ipynb_checkpoints/Create_JupyterKernel_conda-checkpoint.ipynb +++ /dev/null @@ -1,293 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# - Create your own Jupyter CONDA-Kernel -" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "## Building your own Jupyter CONDA-kernel is a three step process\n", - "Download Minconda installer\n", - "1. Download/Install Miniconda\n", - " * Miniconda3.sh\n", - "2. Create Conda Environment\n", - " * conda create\n", - "2. Create/Edit launch script for the Jupyter kernel\n", - " * kernel.sh\n", - "3. Create/Edit Jupyter kernel configuration\n", - " * kernel.json" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Settings" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Selectable **CONDA_TARGET_DIR** path for the central conda installation, should be in the project filesystem" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "export CONDA_TARGET_DIR=${HOME}/PROJECT_training2005/testdir/miniconda3" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Selectable **CONDA_ENV** name, will be used to specify the environment name" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "export CONDA_ENV=my_env" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "## 1. Download/Install Miniconda" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Start here if you want to run the full installation.\n", - "If you want to create another environment in an existing conda setup go to **create environment**. If you want to attach yourself to an existing environment go to **create user kernel**." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.1 - Download Minconda installer" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o $HOME/Miniconda3.sh" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.2 - Create target directory" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mkdir -p ${CONDA_TARGET_DIR}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.3 - Install Miniconda" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "bash $HOME/Miniconda3.sh -b -u -p ${CONDA_TARGET_DIR}" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "${CONDA_TARGET_DIR}/bin/conda init bash" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.4 - Disable automatic activation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "${CONDA_TARGET_DIR}/bin/conda config --set auto_activate_base false" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "## 2. Create conda environment" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create new conda environment. The following steps can be repeated if multiple environments should be created. If the Python version differ towards the external Python version, a mix of Conda modules and external modules will not be possible" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "${CONDA_TARGET_DIR}/bin/conda create -n ${CONDA_ENV} -y python=3.6.8 ipykernel" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "## 3. Create/Edit launch script for the Jupyter kernel" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 3.1 - Create kernel to allow access to the conda environment. Adapte `module purge` and `PYTHONPATH` according to the comments." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "echo '#!/bin/bash\n", - "\n", - "# module purge # optional to disable the external environment, necessary, if python version is different\n", - " \n", - "# Activate your Python virtual environment\n", - "source '\"${CONDA_TARGET_DIR}\"'/bin/activate '\"${CONDA_ENV}\"'\n", - " \n", - "# Ensure python packages installed in conda are always prefered, not necessary if module purge is used\n", - "export PYTHONPATH=${CONDA_PREFIX}/lib/python3.6/site-packages:${PYTHONPATH}\n", - " \n", - "exec python -m ipykernel $@' > ${CONDA_TARGET_DIR}/envs/${CONDA_ENV}/kernel.sh" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "chmod +x ${CONDA_TARGET_DIR}/envs/${CONDA_ENV}/kernel.sh" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "## 4. Create/Edit Jupyter kernel configuration" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 4.1 - Create user kernel, if you want to access the conda environment of a colleague, only these steps are necessary" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mkdir -p $HOME/.local/share/jupyter/kernels/conda_${CONDA_ENV}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 4.2 - Adjust kernel.json file" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "echo '{\n", - " \"argv\": [\n", - " \"'\"${CONDA_TARGET_DIR}\"'/envs/'\"${CONDA_ENV}\"'/kernel.sh\",\n", - " \"-f\",\n", - " \"{connection_file}\"\n", - " ],\n", - " \"display_name\": \"conda_'\"${CONDA_ENV}\"'\",\n", - " \"language\": \"python\"\n", - "}' > $HOME/.local/share/jupyter/kernels/conda_${CONDA_ENV}/kernel.json" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Restart of JupyterLab might be necessary to see the kernel in the kernel selection overview." - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Bash", - "language": "bash", - "name": "bash" - }, - "language_info": { - "codemirror_mode": "shell", - "file_extension": ".sh", - "mimetype": "text/x-sh", - "name": "bash" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/001-Jupyter/.ipynb_checkpoints/Create_JupyterKernel_general-checkpoint.ipynb b/001-Jupyter/.ipynb_checkpoints/Create_JupyterKernel_general-checkpoint.ipynb deleted file mode 100644 index 6b106eea6fc7227ef4a847aed12eb69d92da92a6..0000000000000000000000000000000000000000 --- a/001-Jupyter/.ipynb_checkpoints/Create_JupyterKernel_general-checkpoint.ipynb +++ /dev/null @@ -1,387 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# - Create your own Jupyter Kernel -" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "## Building your own Jupyter kernel is a three step process\n", - "1. Create/Pimp new virtual Python environment\n", - " * venv\n", - "2. Create/Edit launch script for the Jupyter kernel\n", - " * kernel.sh\n", - "3. Create/Edit Jupyter kernel configuration\n", - " * kernel.json" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Settings" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* Set kernel name\n", - " - change if you like" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# INPUT NEEDED:\n", - "export KERNEL_NAME=${USER}_kernel\n", - "\n", - "echo ${KERNEL_NAME} # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* Set kernel type\n", - " - private kernel = \"\\${HOME}/.local/\" \n", - " - project kernel = \"\\${PROJECT}/.local/\" " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# INPUT NEEDED:\n", - "export KERNEL_TYPE=private # private or project\n", - "\n", - "###################\n", - "# private kernel\n", - "if [ \"${KERNEL_TYPE}\" == \"private\" ]; then\n", - " export KERNEL_SPECS_PREFIX=${HOME}/.local\n", - " echo \"private kernel\"\n", - "# project kernel\n", - "else\n", - " export KERNEL_SPECS_PREFIX=${PROJECT}/.local\n", - " echo \"project kernel\"\n", - "fi\n", - "export KERNEL_SPECS_DIR=${KERNEL_SPECS_PREFIX}/share/jupyter/kernels\n", - "\n", - "# check if kernel name is unique\n", - "if [ -d \"${KERNEL_SPECS_DIR}/${KERNEL_NAME}\" ]; then\n", - " echo \"ERROR: Kernel already exists in ${KERNEL_SPECS_DIR}/${KERNEL_NAME}\"\n", - " echo \" Rename kernel name or remove directory.\"\n", - "fi\n", - "\n", - "echo ${KERNEL_SPECS_DIR}/${KERNEL_NAME} # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* Set directory for kernels virtual environment\n", - " - change if you like" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# INPUT NEEDED:\n", - "export KERNEL_VENVS_DIR=${PROJECT}/${USER}/jupyter/kernels\n", - "\n", - "###################\n", - "mkdir -p ${KERNEL_VENVS_DIR}\n", - "if [ \"${KERNEL_TYPE}\" != \"private\" ]; then\n", - " echo \"Please check the permissions and ensure your project partners have read/execute permissions:\"\n", - " namei -l ${KERNEL_VENVS_DIR}\n", - "fi\n", - "\n", - "echo ${KERNEL_VENVS_DIR} # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 1. Create/Pimp new virual Python environment" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.1 - Load required modules" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "module -q purge\n", - "module -q use $OTHERSTAGES \n", - "module -q load Stages/Devel-2019a 2> /dev/null # any stage can be used\n", - "module -q load GCCcore/.8.3.0 2> /dev/null\n", - "module -q load Python/3.6.8 # only Python is required\n", - "module list # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.2 - Load extra modules you need for your kernel" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# module load <module you need>" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.3 - Create and activate a virtual environment for the kernel \n", - "and ensure python packages installed in the virtual environment are always prefered" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "python -m venv --system-site-packages ${KERNEL_VENVS_DIR}/${KERNEL_NAME}\n", - "source ${KERNEL_VENVS_DIR}/${KERNEL_NAME}/bin/activate\n", - "export PYTHONPATH=${VIRTUAL_ENV}/lib/python3.6/site-packages:${PYTHONPATH}\n", - "echo ${VIRTUAL_ENV} # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.4 - Install Python libraries required for communication with Jupyter" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "which pip\n", - "pip install --ignore-installed ipykernel\n", - "ls ${VIRTUAL_ENV}/lib/python3.6/site-packages/ # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 1.5 - Install whatever else you need in your Python virtual environment (using pip)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#pip install <python-package you need>" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2. Create/Edit launch script for the Jupyter kernel" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 2.1 - Create launch script, which loads your Python virtual environment and starts the ipykernel process inside:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "echo \"#!/bin/bash\n", - "\n", - "# Load required modules\n", - "module purge\n", - "module use \"'$OTHERSTAGES'\"\n", - "module load Stages/Devel-2019a\n", - "module load GCCcore/.8.3.0\n", - "module load Python/3.6.8\n", - "\n", - "# Load extra modules you need for your kernel (as you did in step 1.2)\n", - "#module load <module you need>\n", - " \n", - "# Activate your Python virtual environment\n", - "source ${KERNEL_VENVS_DIR}/${KERNEL_NAME}/bin/activate\n", - " \n", - "# Ensure python packages installed in the virtual environment are always prefered\n", - "export PYTHONPATH=${VIRTUAL_ENV}/lib/python3.6/site-packages:\"'${PYTHONPATH}'\"\n", - " \n", - "exec python -m ipykernel \"'$@' > ${VIRTUAL_ENV}/kernel.sh\n", - "chmod +x ${VIRTUAL_ENV}/kernel.sh" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3. Create/Edit Jupyter kernel configuration" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 3.1 - Create Jupyter kernel configuration directory and files" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "python -m ipykernel install --name=${KERNEL_NAME} --prefix ${VIRTUAL_ENV}\n", - "export VIRTUAL_ENV_KERNELS=${VIRTUAL_ENV}/share/jupyter/kernels" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 3.2 - Adjust kernel.json file" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mv ${VIRTUAL_ENV_KERNELS}/${KERNEL_NAME}/kernel.json ${VIRTUAL_ENV_KERNELS}/${KERNEL_NAME}/kernel.json.orig\n", - "\n", - "echo '{\n", - " \"argv\": [\n", - " \"'${KERNEL_VENVS_DIR}/${KERNEL_NAME}/kernel.sh'\",\n", - " \"-m\",\n", - " \"ipykernel_launcher\",\n", - " \"-f\",\n", - " \"{connection_file}\"\n", - " ],\n", - " \"display_name\": \"'${KERNEL_NAME}'\",\n", - " \"language\": \"python\"\n", - "}' > ${VIRTUAL_ENV_KERNELS}/${KERNEL_NAME}/kernel.json" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "* 3.3 - Create link to kernel specs" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cd ${KERNEL_SPECS_DIR}\n", - "ln -s ${VIRTUAL_ENV_KERNELS}/${KERNEL_NAME} .\n", - "ls ${KERNEL_SPECS_DIR} # double check" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 4. Cleanup" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "deactivate" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Bash", - "language": "bash", - "name": "bash" - }, - "language_info": { - "codemirror_mode": "shell", - "file_extension": ".sh", - "mimetype": "text/x-sh", - "name": "bash" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/001-Jupyter/.ipynb_checkpoints/List_JupyterExtensions-checkpoint.ipynb b/001-Jupyter/.ipynb_checkpoints/List_JupyterExtensions-checkpoint.ipynb deleted file mode 100644 index e5d1a2240a159f3822d9de4baebb00c7f4c29138..0000000000000000000000000000000000000000 --- a/001-Jupyter/.ipynb_checkpoints/List_JupyterExtensions-checkpoint.ipynb +++ /dev/null @@ -1,680 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": false - }, - "source": [ - "# List of Extensions on Jupyter@JSC" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If you want to use any of these extensions, feel free to use our [examples](https://github.com/kreuzert/Jupyter-JSC) as a starting point." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## AppMode (Classic Notebook only)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[AppMode](https://github.com/oschuett/appmode) is a Jupyter extension that turns notebooks into web applications. \n", - "To use it click on the menu on \"Help\" -> \"Launch Classic Notebook\"." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Celltags" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The JupyterLab [cell tags](https://github.com/jupyterlab/jupyterlab-celltags) extension enables users to easily add, view, and manipulate descriptive tags for notebook cells. \n", - "The extension includes the functionality to select all cells with a given tag, supporting the performance of any operation on those cells. \n", - "Click on the wrench Symbol on the left sidebar to use it. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Codefolding (Classic Notebook only)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[CodeFolding](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/codefolding) adds codefolding functionality from CodeMirror to a codecell. \n", - "To use it click on the menu on \"Help\" -> \"Launch Classic Notebook\"." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": true - }, - "source": [ - "## Code Formatter" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[Code Formatter](https://github.com/ryantam626/jupyterlab_code_formatter) allows you to format a Notebook for. \n", - "You can use it as shown below or you click on \"Format notebook\" at the top of your notebook. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Dask (only on HPC Systems)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "An [extension](https://github.com/dask/dask-labextension) to manage Dask clusters, as well as embed Dask's dashboard plots directly into JupyterLab panes. \n", - "Watch [this](https://www.youtube.com/watch?feature=player_embedded&v=EX_voquHdk0) video until the end to unterstand how to use Dask in JupyterLab. At the moment we only offer to use the panels inside of JupyterLab. \n", - "We have introduction notebooks for this extensions [here](https://gitlab.version.fz-juelich.de/jupyter4jsc/j4j_notebooks/tree/master/001-Extensions) (or open the gitlab extension on the left sidebar)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Drawio" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[Drawio](https://github.com/QuantStack/jupyterlab-drawio) is a JupyterLab extension for standalone integration of drawio / mxgraph into jupyterlab." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Git" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A JupyterLab [Git](https://github.com/jupyterlab/jupyterlab-git) extension for version control using git." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": true - }, - "source": [ - "## Ipydatawidgets" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[Ipydatawidgets](https://github.com/vidartf/ipydatawidgets) is a set of widgets to help facilitate reuse of large datasets across different widgets, and different packages." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "from ipydatawidgets import DataImage\n", - "np.random.seed(0)\n", - "data = np.array(255 * np.random.rand(200, 200, 4), dtype='uint8')\n", - "DataImage(data=data)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "SIDELEN = 300\n", - "grad = np.linspace(0, 255, SIDELEN, dtype='uint8')\n", - "# red and green components:\n", - "rg = np.dstack(np.meshgrid(grad, grad))\n", - "# add blue and alpha components (zero and 255):\n", - "rgba = np.dstack([\n", - " rg,\n", - " np.zeros((SIDELEN, SIDELEN), dtype='uint8'),\n", - " 255 * np.ones((SIDELEN, SIDELEN), dtype='uint8')\n", - "])\n", - "DataImage(data=rgba)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": true - }, - "source": [ - "## IPyVolume" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[IPyvolume](https://buildmedia.readthedocs.org/media/pdf/ipyvolume/latest/ipyvolume.pdf) is a Python library to visualize 3d volumes and glyphs." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import ipyvolume as ipv\n", - "V = np.zeros((128,128,128))# our 3d array\n", - "# outer box\n", - "V[30:-30,30:-30,30:-30] = 0.75\n", - "V[35:-35,35:-35,35:-35] = 0.0\n", - "# inner box\n", - "V[50:-50,50:-50,50:-50] = 0.25\n", - "V[55:-55,55:-55,55:-55] = 0.0\n", - "ipv.quickvolshow(V, level=[0.25, 0.75], opacity=0.03, level_width=0.1, data_min=0, data_max=1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## JupyterLab LaTeX Extension" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The [LaTeX Extension](https://github.com/jupyterlab/jupyterlab-latex) is an extension for JupyterLab which allows for live-editing of LaTeX documents. \n", - "[Here](https://annefou.github.io/jupyter_publish/03-latex/index.html) you can find a short example." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": true - }, - "source": [ - "## JupyterLab LMod" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[An extension](https://github.com/cmd-ntrf/jupyter-lmod) that allows user to interact with environment modules before launching kernels. \n", - "To check the Pythonpath/PATH of your current kernel just run the following command. Remember to restart the kernel after loading other modules. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!echo $PATH # or !echo $PYTHONPATH" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## JupyterLab Table of Contents" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A [Table of Contents extension](https://github.com/jupyterlab/jupyterlab-toc) for JupyterLab. This auto-generates a table of contents in the left area when you have a notebook or markdown document open. \n", - "The entries are clickable, and scroll the document to the heading in question." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Jupyter ThreeJS" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A Python / [ThreeJS](https://github.com/jupyter-widgets/pythreejs) bridge utilizing the Jupyter widget infrastructure." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": false - }, - "source": [ - "## Leaflet" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The [Jupyterlab Leaflet extension](https://github.com/jupyter-widgets/ipyleaflet) enables interactive maps. \n", - "You can find several example notebooks [here](https://github.com/jupyter-widgets/ipyleaflet/tree/master/examples)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": true - }, - "source": [ - "## MatplotLib" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[MatplotLib](https://www.github.com/matplotlib/jupyter-matplotlib) enables the interactive features of matplotlib in Jupyterlab. \n", - "Besides, the figure canvas element is a proper Jupyter interactive widget which can be positioned in interactive widget layouts." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Enable the matplotlib widget\n", - "%matplotlib widget" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import matplotlib.pyplot as plt\n", - "from mpl_toolkits.mplot3d import axes3d\n", - "\n", - "fig = plt.figure()\n", - "ax = fig.add_subplot(111, projection='3d')\n", - "\n", - "# Grab some test data.\n", - "X, Y, Z = axes3d.get_test_data(0.05)\n", - "\n", - "# Plot a basic wireframe.\n", - "ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)\n", - "\n", - "fig.canvas.layout.max_width = '800px'\n", - "\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# When using the `widget` backend from ipympl,\n", - "# fig.canvas is a proper Jupyter interactive widget, which can be embedded in\n", - "# Layout classes like HBox and Vbox.\n", - "\n", - "# One can bound figure attributes to other widget values.\n", - "import numpy as np\n", - "from ipywidgets import HBox, FloatSlider\n", - "\n", - "plt.ioff()\n", - "plt.clf()\n", - "\n", - "slider = FloatSlider(\n", - " orientation='vertical',\n", - " value=1.0,\n", - " min=0.02,\n", - " max=2.0\n", - ")\n", - "\n", - "fig = plt.figure(3)\n", - "\n", - "x = np.linspace(0, 20, 500)\n", - "\n", - "lines = plt.plot(x, np.sin(slider.value * x))\n", - "\n", - "def update_lines(change):\n", - " lines[0].set_data(x, np.sin(change.new * x))\n", - " fig.canvas.draw()\n", - " fig.canvas.flush_events()\n", - "\n", - "slider.observe(update_lines, names='value')\n", - "\n", - "HBox([slider, fig.canvas])\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## NBDime" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[NBDime](https://github.com/jupyter/nbdime) provides tools for diffing and merging of Jupyter Notebooks." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## NBExtensions Configurator (Classic Notebook only)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A server extension for jupyter notebook which provides configuration interfaces for notebook extensions (nbextensions). \n", - "Works only with the classic notebook, not with JupyterLab. \n", - "To use it click on the menu on \"Help\" -> \"Launch Classic Notebook\". " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "toc-hr-collapsed": true - }, - "source": [ - "## Plotly" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "slideshow": { - "slide_type": "slide" - } - }, - "source": [ - "A JupyterLab [extension](https://github.com/plotly/plotly.py) for [plotly](https://plot.ly/)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "slideshow": { - "slide_type": "fragment" - } - }, - "outputs": [], - "source": [ - "import plotly\n", - "from plotly.offline import init_notebook_mode, iplot\n", - "init_notebook_mode(connected=True)\n", - "trace0 = plotly.graph_objs.Scatter(\n", - " x=[1, 2, 3, 4],\n", - " y=[10, 15, 13, 17]\n", - ")\n", - "trace1 = plotly.graph_objs.Scatter(\n", - " x=[1, 2, 3, 4],\n", - " y=[16, 5, 11, 9]\n", - ")\n", - "\n", - "iplot([trace0, trace1])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Quick Open" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[Quick Open](https://github.com/parente/jupyterlab-quickopen) allows you to quickly open a file in JupyterLab by typing part of its name. Just click on the lens symbol at the left sidebar. \n", - "<span style=\"color:darkorange\">Takes a long time on HPC systems.</span>" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## RISE (Classic Notebook only)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "With [RISE](https://rise.readthedocs.io/en/latest), a Jupyter notebook extension, you can instantly turn your jupyter notebook into a live reveal.js-based presentation. \n", - "To use it click on the menu on \"Help\" -> \"Launch Classic Notebook\"." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Sidecar" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A [sidecar](https://github.com/jupyter-widgets/jupyterlab-sidecar) output widget for JupyterLab" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Voilà Preview" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[Voilà](https://github.com/voila-dashboards/voila) turns Jupyter notebooks into standalone web applications.\n", - "\n", - "Unlike the usual HTML-converted notebooks, each user connecting to the Voilà tornado application gets a dedicated Jupyter kernel which can execute the callbacks to changes in Jupyter interactive widgets. \n", - "\n", - "This extension allows you to render a Notebook with Voilà, so you can see how your Notebook will look with it.\n", - "\n", - "You can download a test notebook with the following command: \n", - "```\n", - " $ wget --no-check-certificate https://jupyter-jsc.fz-juelich.de/static/files/voila_basics.ipynb\n", - "``` \n", - "and get a preview of it with the button at the top of your notebook." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## WebRTC" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "[WebRTC](https://github.com/maartenbreddels/ipywebrtc) allows you to stream video files into Jupyter Notebooks." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "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.6.8" - }, - "toc-autonumbering": false, - "toc-showcode": true, - "toc-showmarkdowntxt": false - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/001-Jupyter/.ipynb_checkpoints/List_PythonPackages-checkpoint.ipynb b/001-Jupyter/.ipynb_checkpoints/List_PythonPackages-checkpoint.ipynb deleted file mode 100644 index f774f6919de12fc9eecfb34240873c474a05cd22..0000000000000000000000000000000000000000 --- a/001-Jupyter/.ipynb_checkpoints/List_PythonPackages-checkpoint.ipynb +++ /dev/null @@ -1,654 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# List of included Python packages" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "This lists the python packages available and installed by the install script for Python, SciPy-Stack and Jupyter:\n", - " - `$EBROOTPYTHON/easybuild/*.eb`\n", - " - `$EBROOTSCIPYMINSTACK/easybuild/*.eb`\n", - " - `$EBROOTJUPYTER/easybuild/*.eb`" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "pkg_list = [\n", - " # Python module\n", - " (\"setuptools\", \"41.6.0\", \"\"),\n", - " (\"webencodings\", \"0.5.1\", \"\"),\n", - " (\"six\", \"1.12.0\", \"\"),\n", - " (\"decorator\", \"4.4.0\", \"\"),\n", - " (\"MarkupSafe\", \"1.1.1\", \"markupsafe\"),\n", - " (\"more-itertools\", \"7.2.0\", \"more_itertools\"),\n", - " (\"pickleshare\", \"0.7.5\", \"\"),\n", - " (\"jedi\", \"0.15.1\", \"\"),\n", - " (\"wcwidth\", \"0.1.7\", \"\"),\n", - " (\"attr\", \"19.3.0\", \"\"),\n", - " (\"parso\", \"0.5.1\", \"\"),\n", - " (\"jinja2\", \"2.10.1\", \"\"),\n", - " (\"pytz\", \"2019.3\", \"\"),\n", - " (\"pyparsing\", \"2.2.0\", \"\"),\n", - " (\"packaging\", \"19.2\", \"\"),\n", - " (\"urllib3\", \"1.25.6\", \"\"),\n", - " (\"certifi\", \"2019.9.11\", \"\"),\n", - " (\"requests\", \"2.22.0\", \"\"),\n", - " (\"python-dateutil\", \"2.8.1\", \"dateutil\"),\n", - " (\"Pillow\", \"6.2.1\", \"PIL\"),\n", - " (\"ply\", \"3.11\", \"\"),\n", - " (\"pyrsistent\", \"0.15.4\", \"\"),\n", - " (\"lxml\", \"4.4.1\", \"\"),\n", - " (\"idna\", \"2.8\", \"\"),\n", - " (\"chardet\", \"3.0.4\", \"\"),\n", - " (\"pycparser\", \"2.19\", \"\"),\n", - " (\"cffi\", \"1.13.2\", \"\"),\n", - " (\"psutil\", \"5.6.3\", \"\"),\n", - " (\"SQLAlchemy\", \"1.3.10\", \"sqlalchemy\"),\n", - " (\"certipy\", \"0.1.3\", \"\"),\n", - " (\"python-editor\", \"1.0.4\", \"editor\"),\n", - " (\"Mako\", \"1.1.0\", \"mako\"),\n", - " (\"alembic\", \"1.2.1\", \"\"),\n", - " (\"click\", \"7.0\", \"\"),\n", - " (\"appdirs\", \"1.4.3\", \"\"),\n", - " (\"cloudpickle\", \"1.2.2\", \"\"),\n", - " (\"toolz\", \"0.10.0\", \"\"),\n", - " (\"cryptography\", \"2.8\", \"\"),\n", - " \n", - " (\"prompt-toolkit\", \"2.0.10\", \"prompt_toolkit\"),\n", - " (\"oauthlib\", \"3.1.0\", \"\"),\n", - " (\"async-generator\", \"1.10\", \"async_generator\"),\n", - " (\"smmap\", \"0.9.0\", \"\"),\n", - " (\"typed-ast\", \"1.4.0\", \"typed_ast\"),\n", - "\n", - " # SciPy-Stack module\n", - " (\"cycler\", \"0.10.0\", \"\"),\n", - " (\"numpy\", \"1.15.2\", \"\"),\n", - " (\"scipy\", \"1.2.1\", \"\"),\n", - " (\"sympy\", \"1.4\", \"\"),\n", - " (\"pandas\", \"0.25.3\", \"\"),\n", - " (\"mpmath\", \"1.1.0\", \"\"),\n", - " (\"kiwisolver\", \"1.1.0\", \"\"),\n", - " (\"backports.functools_lru_cache\", \"1.5\", \"\"),\n", - " (\"matplotlib\", \"3.1.1\", \"\"),\n", - " (\"xarray\", \"0.11.3\", \"\"),\n", - " \n", - " # Jupyter module\n", - " (\"pyOpenSSL\", \"19.0.0\", \"OpenSSL\"),\n", - " (\"entrypoints\", \"0.3\", \"\"),\n", - " (\"async_generator\", \"1.10\", \"\"),\n", - " (\"absl-py\", \"0.8.1\", \"absl\"),\n", - " (\"cryptography\", \"2.8\", \"\"),\n", - " (\"tornado\", \"6.0.3\", \"\"),\n", - " (\"bokeh\", \"1.3.4\", \"\"),\n", - " (\"seaborn\", \"0.9.0\", \"\"),\n", - " (\"nbformat\", \"4.4.0\", \"\"),\n", - " (\"param\", \"1.9.2\", \"\"),\n", - " (\"pyviz_comms\", \"0.7.2\", \"\"),\n", - " (\"holoviews\", \"1.12.6\", \"\"),\n", - " (\"alabaster\", \"0.7.12\", \"\"),\n", - " (\"Babel\", \"2.7.0\", \"babel\"),\n", - " (\"snowballstemmer\", \"2.0.0\", \"\"),\n", - " (\"docutils\", \"0.15.2\", \"\"),\n", - " (\"imagesize\", \"1.1.0\", \"\"),\n", - " (\"sphinxcontrib-websupport\", \"1.1.2\", \"sphinxcontrib.websupport\"),\n", - " (\"Sphinx\", \"1.8.5\", \"sphinx\"),\n", - " (\"pexpect\", \"4.7.0\", \"\"),\n", - " (\"ipython\", \"7.9.0\", \"IPython\"),\n", - " (\"ipynb\", \"0.5.1\", \"\"),\n", - " (\"jupyter_core\", \"4.6.1\", \"\"),\n", - " (\"retrying\", \"1.3.3\", \"\"),\n", - " (\"plotly\", \"4.2.1\", \"\"),\n", - " (\"tikzplotlib\", \"0.8.4\", \"\"),\n", - " (\"jupyter_client\", \"5.3.4\", \"\"),\n", - " (\"traitlets\", \"4.3.3\", \"\"),\n", - " (\"pyzmq\", \"18.1.0\", \"zmq\"),\n", - " (\"singledispatch\", \"3.4.0.3\", \"\"),\n", - " (\"ipyparallel\", \"6.2.4\", \"\"),\n", - " (\"ipykernel\", \"5.1.3\", \"\"),\n", - " (\"terminado\", \"0.8.2\", \"\"),\n", - " (\"bleach\", \"3.1.0\", \"\"),\n", - " (\"mistune\", \"0.8.4\", \"\"),\n", - " (\"pandocfilters\", \"1.4.2\", \"\"),\n", - " (\"Pygments\", \"2.4.2\", \"pygments\"),\n", - " (\"testpath\", \"0.4.4\", \"\"),\n", - " (\"nbconvert\", \"5.6.1\", \"\"),\n", - " (\"ipython_genutils\",\"0.2.0\", \"\"),\n", - " (\"Send2Trash\", \"1.5.0\", \"send2trash\"),\n", - " (\"notebook\", \"6.0.2\", \"\"),\n", - " (\"version_information\", \"1.0.3\", \"\"),\n", - " (\"lesscpy\", \"0.13.0\", \"\"),\n", - " (\"prometheus-client\", \"0.7.1\", \"prometheus_client\"),\n", - " (\"jupyterthemes\", \"0.20.0\", \"\"),\n", - " (\"zipp\", \"0.6.0\", \"\"),\n", - " (\"importlib_metadata\", \"0.23\", \"\"),\n", - " (\"jsonschema\", \"3.1.1\", \"\"),\n", - " (\"jupyterlab_launcher\", \"0.13.1\",\"\"),\n", - " (\"sphinx_rtd_theme\",\"0.4.3\", \"\"),\n", - " (\"future\", \"0.18.1\", \"\"),\n", - " (\"commonmark\", \"0.9.1\", \"\"),\n", - " (\"recommonmark\", \"0.6.0\", \"\"),\n", - " (\"jupyterlab\", \"1.2.1\", \"\"),\n", - " (\"json5\", \"0.8.5\", \"\"),\n", - " (\"jupyterlab_server\", \"1.0.6\", \"\"),\n", - " (\"ptyprocess\", \"0.6.0\", \"\"),\n", - " (\"defusedxml\", \"0.6.0\", \"\"),\n", - " (\"widgetsnbextension\", \"3.5.1\", \"\"),\n", - " (\"ipywidgets\", \"7.5.1\", \"\"),\n", - " (\"ipydatawidgets\", \"4.0.1\", \"\"),\n", - " (\"traittypes\", \"0.2.1\", \"\"),\n", - " (\"bqplot\", \"0.11.9\", \"\"),\n", - " (\"jupyter_bokeh\", \"1.1.1\", \"\"),\n", - " (\"pythreejs\", \"2.1.1\", \"\"),\n", - " (\"PyWavelets\", \"1.1.1\", \"pywt\"),\n", - " (\"imageio\", \"2.6.1\", \"\"),\n", - " (\"networkx\", \"2.3\", \"\"),\n", - " (\"scikit-image\", \"0.16.2\", \"skimage\"),\n", - " (\"ipywebrtc\", \"0.5.0\", \"\"),\n", - " (\"ipyvolume\", \"0.5.2\", \"\"),\n", - " (\"branca\", \"0.3.1\", \"\"),\n", - " (\"ipyleaflet\", \"0.11.4\", \"\"),\n", - " (\"ipympl\", \"0.3.3\", \"\"),\n", - " (\"PyYAML\", \"5.1.2\", \"yaml\"),\n", - " (\"jupyter_nbextensions_configurator\", \"0.4.1\", \"\"),\n", - " (\"jupyter_latex_envs\", \"1.4.6\", \"latex_envs\"),\n", - " (\"jupyter_highlight_selected_word\", \"0.2.0\", \"\"),\n", - " (\"jupyter_contrib_core\", \"0.3.3\",\"\"),\n", - " (\"jupyter_contrib_nbextensions\", \"0.5.1\", \"\"),\n", - " (\"rise\", \"5.5.1\", \"\"),\n", - " (\"typing-extensions\", \"3.7.4\", \"typing_extensions\"),\n", - " (\"idna-ssl\", \"1.1.0\", \"idna_ssl\"),\n", - " (\"multidict\", \"4.5.2\", \"\"),\n", - " (\"yarl\", \"1.3.0\", \"\"),\n", - " (\"async-timeout\", \"3.0.1\", \"async_timeout\"),\n", - " (\"aiohttp\", \"3.6.2\", \"\"),\n", - " (\"simpervisor\", \"0.3\", \"\"),\n", - " (\"jupyter_server\", \"0.1.1\", \"\"),\n", - " (\"jupyter-server-proxy\", \"1.1.0\", \"jupyter_server_proxy\"),\n", - " (\"jupyterlab_github\", \"1.0.1\", \"\"),\n", - " (\"jupyterlab-gitlab\", \"0.3.0\", \"jupyterlab_gitlab\"),\n", - " (\"jupyterlab-quickopen\", \"0.3.0\", \"jupyterlab_quickopen\"),\n", - " (\"zstandard\", \"0.12.0\", \"\"),\n", - " (\"itk_core\", \"5.0.1\", \"\"),\n", - " (\"itk_filtering\", \"5.0.1\", \"\"),\n", - " (\"itk_segmentation\",\"5.0.1\", \"\"),\n", - " (\"itk_numerics\", \"5.0.1\", \"\"),\n", - " (\"itk_registration\",\"5.0.1\", \"\"),\n", - " (\"itk_io\", \"5.0.1\", \"\"),\n", - " (\"itk-meshtopolydata\", \"0.5.1\", \"\"),\n", - " (\"pyct\", \"0.4.6\", \"\"),\n", - " (\"colorcet\", \"2.0.2\", \"\"),\n", - " (\"itkwidgets\", \"0.22.0\", \"\"),\n", - " (\"ujson\", \"1.35\", \"\"),\n", - " (\"jupyterlab_iframe\", \"0.2.1\", \"\"),\n", - " (\"python-dotenv\", \"0.10.3\", \"dotenv\"),\n", - " (\"jupyterlab_latex\",\"1.0.0\", \"\"),\n", - " (\"jupyterlab_slurm\",\"1.0.5\", \"\"),\n", - " (\"jupyterlmod\", \"1.7.5\", \"\"),\n", - " (\"nbresuse\", \"0.3.2\", \"\"),\n", - " (\"colorama\", \"0.4.1\", \"\"),\n", - " (\"nbdime\", \"1.1.0\", \"\"),\n", - " (\"smmap2\", \"2.0.5\", \"smmap\"),\n", - " (\"gitdb2\", \"2.0.6\", \"gitdb\"),\n", - " (\"GitPython\", \"3.0.4\", \"git\"),\n", - " (\"jupyterlab-git\", \"0.8.1\", \"jupyterlab_git\"),\n", - " (\"sidecar\", \"0.3.0\", \"\"),\n", - " (\"pycodestyle\", \"2.5.0\", \"\"),\n", - " (\"autopep8\", \"1.4.4\", \"\"),\n", - " (\"yapf\", \"0.28.0\", \"\"),\n", - " (\"toml\", \"0.10.0\", \"\"),\n", - " (\"pathspec\", \"0.6.0\", \"\"),\n", - " (\"typed_ast\", \"1.4.0\", \"\"),\n", - " (\"regex\", \"2019.11.1\",\"\"),\n", - " (\"black\", \"19.3b0\", \"\"),\n", - " (\"jupyterlab-code-formatter\", \"0.6.1\", \"jupyterlab_code_formatter\"),\n", - " (\"pamela\", \"1.0.0\", \"\"),\n", - " (\"certipy\", \"0.1.3\", \"\"),\n", - " (\"oauthlib\", \"3.1.0\", \"\"),\n", - " (\"jupyterhub\", \"1.0.0\", \"\"),\n", - " (\"appmode\", \"0.6.0\", \"\"),\n", - " (\"HeapDict\", \"1.0.1\", \"heapdict\"),\n", - " (\"zict\", \"1.0.0\", \"\"),\n", - " (\"tblib\", \"1.5.0\", \"\"),\n", - " (\"sortedcontainers\",\"2.1.0\", \"\"),\n", - " (\"msgpack\", \"0.6.2\", \"\"),\n", - " (\"dask\", \"2.6.0\", \"\"),\n", - " (\"distributed\", \"2.6.0\", \"\"),\n", - " (\"dask-jobqueue\", \"0.7.0\", \"\"),\n", - " (\"dask_labextension\", \"1.0.3\", \"\"),\n", - " (\"Automat\", \"0.8.0\", \"automat\"),\n", - " (\"PyHamcrest\", \"1.9.0\", \"hamcrest\"),\n", - " (\"Twisted\", \"19.7.0\", \"twisted\"),\n", - " (\"autobahn\", \"19.10.1\", \"\"),\n", - " (\"constantly\", \"15.1.0\", \"\"),\n", - " (\"hyperlink\", \"19.0.0\", \"\"),\n", - " (\"incremental\", \"17.5.0\", \"\"),\n", - " (\"txaio\", \"18.8.1\", \"\"),\n", - " (\"zope.interface\", \"4.6.0\", \"\"),\n", - " (\"backcall\", \"0.1.0\", \"\"),\n", - " (\"wslink\", \"0.1.11\", \"\"),\n", - " (\"jupyterlab_pygments\", \"0.1.0\",\"\"),\n", - " (\"ipyvue\", \"1.0.0\", \"\"),\n", - " (\"ipyvuetify\", \"1.1.1\", \"\"),\n", - " (\"voila\", \"0.1.14\", \"\"),\n", - " (\"voila-material\", \"0.2.5\", \"-\"),\n", - " (\"voila-gridstack\", \"0.0.6\", \"-\"),\n", - " (\"voila-vuetify\", \"0.1.1\", \"-\"), \n", - " (\"dicom-upload\", \"v0.1.0\", \"\"),\n", - " (\"fileupload\", \"master\", \"\"),\n", - " (\"pvlink\", \"0.1.2\", \"\"),\n", - " (\"julia\", \"0.5.0\", \"\"),\n", - " (\"textwrap3\", \"0.9.2\", \"\"),\n", - " (\"ansiwrap\", \"0.8.4\", \"\"),\n", - " (\"backports.weakref\",\"1.0.post1\",\"\"),\n", - " (\"backports.tempfile\",\"1.0\", \"\"),\n", - " (\"tqdm\", \"4.41.0\", \"\"),\n", - " (\"tenacity\", \"6.0.0\", \"\"),\n", - " (\"papermill\", \"1.2.1\", \"\"),\n", - " \n", - " # PythonPackages for Tutorials\n", - " (\"patsy\", \"0.5.1\", \"\"),\n", - " (\"statsmodels\", \"0.10.2\", \"\"),\n", - " (\"cftime\", \"1.0.4.2\", \"\"),\n", - " (\"vega_datasets\", \"0.8.0\", \"\"),\n", - " (\"arviz\", \"0.5.1\", \"\"),\n", - " (\"Theano\", \"1.0.4\", \"\"),\n", - " (\"altair\", \"3.3.0\", \"\"),\n", - " (\"cssselect\", \"1.1.0\", \"\"),\n", - " (\"smopy\", \"0.0.7\", \"\"),\n", - " (\"joblib\", \"0.14.1\", \"\"),\n", - " (\"scikit-learn\", \"0.22\", \"\"),\n", - " (\"memory_profiler\", \"0.55.0\", \"\"),\n", - " (\"h5py\", \"2.10.0\", \"\"),\n", - " (\"line_profiler\", \"2.1.2\", \"\"),\n", - " (\"pymc3\", \"3.8\", \"\"),\n", - " (\"llvmlite\", \"0.30.0\", \"\"),\n", - " (\"numba\", \"0.46.0\", \"\"),\n", - " (\"numexpr\", \"2.7.0\", \"\"),\n", - " (\"ipythonblocks\", \"1.9.0\", \"\"),\n", - " (\"pydub\", \"0.23.1\", \"\"),\n", - " (\"multipledispatch\",\"0.6.0\", \"\"),\n", - " (\"partd\", \"1.1.0\", \"\"),\n", - " (\"locket\", \"0.2.0\", \"\"),\n", - " (\"fsspec\", \"0.6.2\", \"\"),\n", - " (\"datashape\", \"0.5.2\", \"\"),\n", - " (\"datashader\", \"0.9.0\", \"\"),\n", - " (\"selenium\", \"3.141.0\", \"\"),\n", - " (\"graphviz\", \"0.13.2\", \"\"),\n", - " (\"vincent\", \"0.4.4\", \"\"),\n", - " (\"Shapely\", \"1.6.4.post2\",\"\"),\n", - " (\"pyshp\", \"2.1.0\", \"\"),\n", - " (\"Cartopy\", \"0.17.0\", \"\"),\n", - " (\"pandas-datareader\",\"0.8.1\", \"\"),\n", - "]\n", - "\n", - "from pip._vendor import pkg_resources\n", - "def get_version(package):\n", - " package = package.lower()\n", - " return next((p.version for p in pkg_resources.working_set if p.project_name.lower() == package), f\"{Fore.RED}NO MATCH{Style.RESET_ALL}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Run a Sanity Check\n", - "A test of the Python packages follows here. \n", - "\n", - "Attention:\n", - " - Slight changes in the version numbers are due to compatibility problems we encountered and therefore had to make adjustments.\n", - " - \"NO MATCH\" - Not all package versions can be automatically found by this script\n", - " - \"IMPORT FAILED\" - Import failures are possible if python packages are not ment to be importable by the developer." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "PYPI NAME : IMPORT NAME REQ.VERS.|INST.VERS. IMPORT TIME\n", - "=================================================================================\n", - "setuptools : setuptools 41.6.0 0.385978s\n", - "webencodings : webencodings 0.5.1 0.016903s\n", - "six : six 1.12.0 0.000052s\n", - "decorator : decorator 4.4.0 0.000052s\n", - "MarkupSafe : markupsafe 1.1.1 0.006108s\n", - "more-itertools : more_itertools 7.2.0 != \u001b[31m7.0.0 \u001b[0m 0.030407s\n", - "pickleshare : pickleshare 0.7.5 0.000044s\n", - "jedi : jedi 0.15.1 != \u001b[31m0.13.3 \u001b[0m 0.000032s\n", - "wcwidth : wcwidth 0.1.7 0.000029s\n", - "attr : attr 19.3.0 != \u001b[31m19.1.0 \u001b[0m 0.017762s\n", - "parso : parso 0.5.1 != \u001b[31m0.3.4 \u001b[0m 0.000041s\n", - "jinja2 : jinja2 2.10.1 != \u001b[31m2.10 \u001b[0m 0.028386s\n", - "pytz : pytz 2019.3 != \u001b[31m2019.1 \u001b[0m 0.093399s\n", - "pyparsing : pyparsing 2.2.0 != \u001b[31m2.3.1 \u001b[0m 0.049335s\n", - "packaging : packaging 19.2 != \u001b[31m19.0 \u001b[0m 0.027138s\n", - "urllib3 : urllib3 1.25.6 != \u001b[31m1.24.1 \u001b[0m 0.019931s\n", - "certifi : certifi 2019.9.11 != \u001b[31m2019.03.09\u001b[0m 0.002952s\n", - "requests : requests 2.22.0 != \u001b[31m2.21.0 \u001b[0m 0.288162s\n", - "python-dateutil : dateutil 2.8.1 != \u001b[31m2.8.0 \u001b[0m 0.000026s\n", - "Pillow : PIL 6.2.1 != \u001b[31m6.0.0 \u001b[0m 0.007693s\n", - "ply : ply 3.11 0.019242s\n", - "pyrsistent : pyrsistent 0.15.4 != \u001b[31m0.14.11 \u001b[0m 0.013004s\n", - "lxml : lxml 4.4.1 != \u001b[31m4.3.3 \u001b[0m 0.055928s\n", - "idna : idna 2.8 0.000051s\n", - "chardet : chardet 3.0.4 0.000036s\n", - "pycparser : pycparser 2.19 0.207475s\n", - "cffi : cffi 1.13.2 != \u001b[31m1.12.2 \u001b[0m 0.015289s\n", - "psutil : psutil 5.6.3 != \u001b[31m5.6.1 \u001b[0m 0.046984s\n", - "SQLAlchemy : sqlalchemy 1.3.10 != \u001b[31m1.3.1 \u001b[0m 0.994233s\n", - "certipy : certipy 0.1.3 0.037884s\n", - "python-editor : editor 1.0.4 0.007516s\n", - "Mako : mako 1.1.0 != \u001b[31m1.0.8 \u001b[0m 0.053407s\n", - "alembic : alembic 1.2.1 != \u001b[31m1.0.8 \u001b[0m 1.590335s\n", - "click : click 7.0 0.018214s\n", - "appdirs : appdirs 1.4.3 0.012561s\n", - "cloudpickle : cloudpickle 1.2.2 != \u001b[31m0.8.1 \u001b[0m 0.006038s\n", - "toolz : toolz 0.10.0 != \u001b[31m0.9.0 \u001b[0m 0.020046s\n", - "cryptography : cryptography 2.8 0.000043s\n", - "prompt-toolkit : prompt_toolkit 2.0.10 != \u001b[31m2.0.9 \u001b[0m 0.000035s\n", - "oauthlib : oauthlib 3.1.0 0.009413s\n", - "async-generator : async_generator 1.10 0.009577s\n", - "smmap : smmap 0.9.0 != \u001b[31m2.0.5 \u001b[0m 0.005029s\n", - "typed-ast : typed_ast 1.4.0 0.007294s\n", - "cycler : cycler 0.10.0 0.007537s\n", - "numpy : numpy 1.15.2 0.509992s\n", - "scipy : scipy 1.2.1 0.028397s\n", - "sympy : sympy 1.4 != \u001b[31m1.3 \u001b[0m 7.210424s\n", - "pandas : pandas 0.25.3 != \u001b[31m0.24.2 \u001b[0m 1.315975s\n", - "mpmath : mpmath 1.1.0 0.000075s\n", - "kiwisolver : kiwisolver 1.1.0 != \u001b[31m1.0.1 \u001b[0m 0.033678s\n", - "backports.functools_lru_cache : backports.functools_lru_cache \u001b[31mIMPORT FAILED\u001b[0m\n", - "matplotlib : matplotlib 3.1.1 != \u001b[31m3.0.3 \u001b[0m 0.000086s\n", - "xarray : xarray 0.11.3 != \u001b[31m0.12.1 \u001b[0m 1.172104s\n", - "pyOpenSSL : OpenSSL 19.0.0 0.000034s\n", - "entrypoints : entrypoints 0.3 0.002844s\n", - "async_generator : async_generator 1.10 0.000047s\n", - "absl-py : absl 0.8.1 0.012326s\n", - "cryptography : cryptography 2.8 0.000051s\n", - "tornado : tornado 6.0.3 0.000029s\n", - "bokeh : bokeh 1.3.4 0.089318s\n", - "seaborn : seaborn 0.9.0 11.679716s\n", - "nbformat : nbformat 4.4.0 0.195660s\n", - "param : param 1.9.2 0.209250s\n", - "pyviz_comms : pyviz_comms 0.7.2 0.092592s\n", - "holoviews : holoviews 1.12.6 1.424016s\n", - "alabaster : alabaster 0.7.12 0.014988s\n", - "Babel : babel 2.7.0 0.081024s\n", - "snowballstemmer : snowballstemmer 2.0.0 0.351891s\n", - "docutils : docutils 0.15.2 0.027402s\n", - "imagesize : imagesize 1.1.0 0.004413s\n", - "sphinxcontrib-websupport : sphinxcontrib.websupport 1.1.2 0.889744s\n", - "Sphinx : sphinx 1.8.5 0.000060s\n", - "pexpect : pexpect 4.7.0 0.000043s\n", - "ipython : IPython 7.9.0 0.000038s\n", - "ipynb : ipynb 0.5.1 0.014553s\n", - "jupyter_core : jupyter_core 4.6.1 0.000053s\n", - "retrying : retrying 1.3.3 0.020777s\n", - "plotly : plotly 4.2.1 6.939769s\n", - "tikzplotlib : tikzplotlib 0.8.4 0.114980s\n", - "jupyter_client : jupyter_client 5.3.4 0.000043s\n", - "traitlets : traitlets 4.3.3 0.000031s\n", - "pyzmq : zmq 18.1.0 0.000028s\n", - "singledispatch : singledispatch 3.4.0.3 0.062908s\n", - "ipyparallel : ipyparallel 6.2.4 0.000068s\n", - "ipykernel : ipykernel 5.1.3 0.000048s\n", - "terminado : terminado 0.8.2 0.047164s\n", - "bleach : bleach 3.1.0 0.469373s\n", - "mistune : mistune 0.8.4 0.023354s\n", - "pandocfilters : pandocfilters 1.4.2 0.001329s\n", - "Pygments : pygments 2.4.2 0.000043s\n", - "testpath : testpath 0.4.4 0.003176s\n", - "nbconvert : nbconvert 5.6.1 0.042023s\n", - "ipython_genutils : ipython_genutils 0.2.0 0.000036s\n", - "Send2Trash : send2trash 1.5.0 0.010062s\n", - "notebook : notebook 6.0.2 0.000031s\n", - "version_information : version_information 1.0.3 0.047597s\n", - "lesscpy : lesscpy 0.13.0 0.005995s\n", - "prometheus-client : prometheus_client 0.7.1 0.025599s\n", - "jupyterthemes : jupyterthemes 0.20.0 0.052266s\n", - "zipp : zipp 0.6.0 0.000048s\n", - "importlib_metadata : importlib_metadata 0.23 0.000036s\n", - "jsonschema : jsonschema 3.1.1 0.000030s\n", - "jupyterlab_launcher : jupyterlab_launcher 0.13.1 0.109656s\n", - "sphinx_rtd_theme : sphinx_rtd_theme 0.4.3 0.008458s\n", - "future : future 0.18.1 0.006830s\n", - "commonmark : commonmark 0.9.1 0.095996s\n", - "recommonmark : recommonmark 0.6.0 0.002422s\n", - "jupyterlab : jupyterlab 1.2.1 0.002643s\n", - "json5 : json5 0.8.5 0.003840s\n", - "jupyterlab_server : jupyterlab_server 1.0.6 0.004840s\n", - "ptyprocess : ptyprocess 0.6.0 0.000037s\n", - "defusedxml : defusedxml 0.6.0 0.000027s\n", - "widgetsnbextension : widgetsnbextension 3.5.1 0.016441s\n", - "ipywidgets : ipywidgets 7.5.1 0.000042s\n", - "ipydatawidgets : ipydatawidgets 4.0.1 0.134411s\n", - "traittypes : traittypes 0.2.1 0.000048s\n", - "bqplot : bqplot 0.11.9 0.271027s\n", - "jupyter_bokeh : jupyter_bokeh 1.1.1 != \u001b[31m\u001b[31mNO MATCH\u001b[0m\u001b[0m 1.545438s\n", - "pythreejs : pythreejs 2.1.1 1.858083s\n", - "PyWavelets : pywt 1.1.1 0.377231s\n", - "imageio : imageio 2.6.1 0.387762s\n", - "networkx : networkx 2.3 3.447984s\n", - "scikit-image : skimage 0.16.2 0.284224s\n", - "ipywebrtc : ipywebrtc 0.5.0 0.040460s\n", - "ipyvolume : ipyvolume 0.5.2 0.409094s\n", - "branca : branca 0.3.1 0.226449s\n", - "ipyleaflet : ipyleaflet 0.11.4 0.070324s\n", - "ipympl : ipympl 0.3.3 0.123354s\n", - "PyYAML : yaml 5.1.2 0.000082s\n", - "jupyter_nbextensions_configurator : jupyter_nbextensions_configurator 0.4.1 0.003318s\n", - "jupyter_latex_envs : latex_envs 1.4.6 != \u001b[31m1.4.0 \u001b[0m 0.005721s\n", - "jupyter_highlight_selected_word : jupyter_highlight_selected_word 0.2.0 0.020243s\n", - "jupyter_contrib_core : jupyter_contrib_core 0.3.3 0.002995s\n", - "jupyter_contrib_nbextensions : jupyter_contrib_nbextensions 0.5.1 0.002769s\n", - "rise : rise 5.5.1 0.188142s\n", - "typing-extensions : typing_extensions 3.7.4 0.037277s\n", - "idna-ssl : idna_ssl 1.1.0 0.002152s\n", - "multidict : multidict 4.5.2 0.004443s\n", - "yarl : yarl 1.3.0 0.003127s\n", - "async-timeout : async_timeout 3.0.1 0.003045s\n", - "aiohttp : aiohttp 3.6.2 0.077788s\n", - "simpervisor : simpervisor 0.3 0.003966s\n", - "jupyter_server : jupyter_server 0.1.1 0.001706s\n", - "jupyter-server-proxy : jupyter_server_proxy 1.1.0 != \u001b[31m1.2.0 \u001b[0m 0.004240s\n", - "jupyterlab_github : jupyterlab_github 1.0.1 != \u001b[31m1.0.0 \u001b[0m 0.000919s\n", - "jupyterlab-gitlab : jupyterlab_gitlab 0.3.0 != \u001b[31m0.2.0 \u001b[0m 0.001144s\n", - "jupyterlab-quickopen : jupyterlab_quickopen 0.3.0 0.002939s\n", - "zstandard : zstandard 0.12.0 0.000029s\n", - "itk_core : itk_core \u001b[31mIMPORT FAILED\u001b[0m\n", - "itk_filtering : itk_filtering \u001b[31mIMPORT FAILED\u001b[0m\n", - "itk_segmentation : itk_segmentation \u001b[31mIMPORT FAILED\u001b[0m\n", - "itk_numerics : itk_numerics \u001b[31mIMPORT FAILED\u001b[0m\n", - "itk_registration : itk_registration \u001b[31mIMPORT FAILED\u001b[0m\n", - "itk_io : itk_io \u001b[31mIMPORT FAILED\u001b[0m\n", - "itk-meshtopolydata : itk-meshtopolydata \u001b[31mIMPORT FAILED\u001b[0m\n", - "pyct : pyct 0.4.6 0.076661s\n", - "colorcet : colorcet 2.0.2 != \u001b[31m1.0.0 \u001b[0m 1.035480s\n", - "itkwidgets : itkwidgets 0.22.0 13.082362s\n", - "ujson : ujson 1.35 0.037301s\n", - "jupyterlab_iframe : jupyterlab_iframe 0.2.1 0.004151s\n", - "python-dotenv : dotenv 0.10.3 0.056290s\n", - "jupyterlab_latex : jupyterlab_latex 1.0.0 0.004882s\n", - "jupyterlab_slurm : jupyterlab_slurm 1.0.5 0.002469s\n", - "jupyterlmod : jupyterlmod 1.7.5 0.003136s\n", - "nbresuse : nbresuse 0.3.2 0.001697s\n", - "colorama : colorama 0.4.1 0.000065s\n", - "nbdime : nbdime 1.1.0 0.020851s\n", - "smmap2 : smmap 2.0.5 0.000058s\n", - "gitdb2 : gitdb 2.0.6 0.025730s\n", - "GitPython : git 3.0.4 0.099233s\n", - "jupyterlab-git : jupyterlab_git 0.8.1 0.016555s\n", - "sidecar : sidecar 0.3.0 0.018072s\n", - "pycodestyle : pycodestyle 2.5.0 0.007567s\n", - "autopep8 : autopep8 1.4.4 0.004303s\n", - "yapf : yapf 0.28.0 0.025461s\n", - "toml : toml 0.10.0 0.003055s\n", - "pathspec : pathspec 0.6.0 0.077891s\n", - "typed_ast : typed_ast 1.4.0 0.000055s\n", - "regex : regex 2019.11.1 != \u001b[31m2.5.65 \u001b[0m 0.087107s\n", - "black : black 19.3b0 0.265862s\n", - "jupyterlab-code-formatter : jupyterlab_code_formatter 0.6.1 0.001970s\n", - "pamela : pamela 1.0.0 0.081929s\n", - "certipy : certipy 0.1.3 0.000066s\n", - "oauthlib : oauthlib 3.1.0 0.000042s\n", - "jupyterhub : jupyterhub 1.0.0 0.003949s\n", - "appmode : appmode 0.6.0 0.001285s\n", - "HeapDict : heapdict 1.0.1 0.000043s\n", - "zict : zict 1.0.0 0.000043s\n", - "tblib : tblib 1.5.0 0.000032s\n", - "sortedcontainers : sortedcontainers 2.1.0 0.000033s\n", - "msgpack : msgpack 0.6.2 0.000029s\n", - "dask : dask 2.6.0 0.000039s\n", - "distributed : distributed 2.6.0 0.000030s\n", - "dask-jobqueue : dask-jobqueue \u001b[31mIMPORT FAILED\u001b[0m\n", - "dask_labextension : dask_labextension 1.0.3 0.012876s\n", - "Automat : automat 0.8.0 0.056752s\n", - "PyHamcrest : hamcrest 1.9.0 0.317690s\n", - "Twisted : twisted 19.7.0 0.044753s\n", - "autobahn : autobahn 19.10.1 0.006888s\n", - "constantly : constantly 15.1.0 0.039913s\n", - "hyperlink : hyperlink 19.0.0 0.074022s\n", - "incremental : incremental 17.5.0 0.000064s\n", - "txaio : txaio 18.8.1 0.038220s\n", - "zope.interface : zope.interface 4.6.0 0.138110s\n", - "backcall : backcall 0.1.0 0.000064s\n", - "wslink : wslink 0.1.11 0.007843s\n", - "jupyterlab_pygments : jupyterlab_pygments 0.1.0 0.009341s\n", - "ipyvue : ipyvue 1.0.0 0.025899s\n", - "ipyvuetify : ipyvuetify 1.1.1 0.414047s\n", - "voila : voila 0.1.14 0.010617s\n", - "voila-material : - 0.2.5 0.000001s\n", - "voila-gridstack : - 0.0.6 0.000000s\n", - "voila-vuetify : - 0.1.1 0.000000s\n", - "dicom-upload : dicom-upload \u001b[31mIMPORT FAILED\u001b[0m\n", - "fileupload : fileupload master != \u001b[31m0.1.0.dev \u001b[0m 0.014791s\n", - "pvlink : pvlink 0.1.2 0.012866s\n", - "julia : julia 0.5.0 0.102546s\n", - "textwrap3 : textwrap3 0.9.2 0.023105s\n", - "ansiwrap : ansiwrap 0.8.4 0.039140s\n", - "backports.weakref : backports.weakref 1.0.post1 0.020673s\n", - "backports.tempfile : backports.tempfile 1.0 0.006095s\n", - "tqdm : tqdm 4.41.0 0.101886s\n", - "tenacity : tenacity 6.0.0 0.093667s\n", - "papermill : papermill 1.2.1 0.417333s\n", - "patsy : patsy 0.5.1 0.281202s\n", - "statsmodels : statsmodels 0.10.2 0.000063s\n", - "cftime : cftime 1.0.4.2 0.000048s\n", - "vega_datasets : vega_datasets 0.8.0 0.124947s\n", - "arviz : arviz 0.5.1 8.192571s\n", - "Theano : Theano \u001b[31mIMPORT FAILED\u001b[0m\n", - "altair : altair 3.3.0 0.572322s\n", - "cssselect : cssselect 1.1.0 0.074927s\n", - "smopy : smopy 0.0.7 != \u001b[31m0.0.6 \u001b[0m 0.005187s\n", - "joblib : joblib 0.14.1 0.000062s\n", - "scikit-learn : scikit-learn \u001b[31mIMPORT FAILED\u001b[0m\n", - "memory_profiler : memory_profiler 0.55.0 0.048130s\n", - "h5py : h5py 2.10.0 1.163224s\n", - "line_profiler : line_profiler 2.1.2 != \u001b[31m\u001b[31mNO MATCH\u001b[0m\u001b[0m 0.041151s\n", - "pymc3 : pymc3 3.8 6.798788s\n", - "llvmlite : llvmlite 0.30.0 0.000073s\n", - "numba : numba 0.46.0 0.000051s\n", - "numexpr : numexpr 2.7.0 0.101310s\n", - "ipythonblocks : ipythonblocks 1.9.0 0.023981s\n", - "pydub : pydub 0.23.1 0.209780s\n", - "multipledispatch : multipledispatch 0.6.0 0.062537s\n", - "partd : partd 1.1.0 0.168488s\n", - "locket : locket 0.2.0 0.000052s\n", - "fsspec : fsspec 0.6.2 0.136985s\n", - "datashape : datashape 0.5.2 0.177264s\n", - "datashader : datashader 0.9.0 13.161141s\n", - "selenium : selenium 3.141.0 0.009461s\n", - "graphviz : graphviz 0.13.2 0.088085s\n", - "vincent : vincent 0.4.4 0.167066s\n", - "Shapely : Shapely \u001b[31mIMPORT FAILED\u001b[0m\n", - "pyshp : pyshp \u001b[31mIMPORT FAILED\u001b[0m\n", - "Cartopy : Cartopy \u001b[31mIMPORT FAILED\u001b[0m\n", - "pandas-datareader : pandas-datareader \u001b[31mIMPORT FAILED\u001b[0m\n" - ] - } - ], - "source": [ - "import importlib\n", - "from colorama import Fore, Style\n", - "from timeit import default_timer as timer\n", - "\n", - "print(\"PYPI NAME\".ljust(20), \": \", \"IMPORT NAME\".ljust(20) + \"REQ.VERS.|INST.VERS.\".ljust(25) + \"IMPORT TIME\")\n", - "print(\"=================================================================================\")\n", - "for pkg_name, pkg_version, pkg_importname in pkg_list:\n", - " if not pkg_importname:\n", - " pkg_importname = pkg_name\n", - " pkg = None\n", - " \n", - " try:\n", - " # import package\n", - " start_time = timer()\n", - " if pkg_importname != \"-\":\n", - " pkg = importlib.import_module(pkg_importname)\n", - " import_time = timer() - start_time\n", - " \n", - " # get version\n", - " try:\n", - " version = pkg.__version__\n", - " if not isinstance(pkg.__version__, str):\n", - " raise\n", - " except:\n", - " version = get_version(pkg_name)\n", - " \n", - " if version != pkg_version:\n", - " version = pkg_version.ljust(10) + \" != \" + f\"{Fore.RED}\" + version.ljust(10) + f\"{Style.RESET_ALL}\"\n", - "\n", - " print(pkg_name.ljust(20), \": \", pkg_importname.ljust(20), version.ljust(24), f\"{import_time:.6f}\"+\"s\")\n", - " except:\n", - " print(pkg_name.ljust(20), \": \", pkg_importname.ljust(20), f\"{Fore.RED}IMPORT FAILED{Style.RESET_ALL}\") \n", - " \n", - " #try:\n", - " # print(\"\".ljust(24), pkg.__file__)\n", - " #except:\n", - " # print(\"\".ljust(24), f\"{Fore.RED}UNKNOWN{Style.RESET_ALL}\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "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.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/001-Jupyter/002-JupyterExtensions/.ipynb_checkpoints/CodeFormatter-checkpoint.ipynb b/001-Jupyter/002-JupyterExtensions/.ipynb_checkpoints/CodeFormatter-checkpoint.ipynb deleted file mode 100644 index e88a7dcf474f20d8d73544fd4a2efb1a5c1eb27f..0000000000000000000000000000000000000000 --- a/001-Jupyter/002-JupyterExtensions/.ipynb_checkpoints/CodeFormatter-checkpoint.ipynb +++ /dev/null @@ -1,80 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - " # Press \"Format notebook\" or in the menu \"Edit -> Apply ... Formatter\"\n", - " # useless comment\n", - "import requests # useless comment\n", - "\n", - "headers = {\n", - " 'Referer': 'https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time',\n", - " 'Origin': 'https://www.transtats.bts.gov',\n", - " 'Content-Type': 'application/x-www-form-urlencoded',\n", - "}\n", - "\n", - "params = (\n", - " ('Table_ID', '236'),\n", - " ('Has_Group', '3'), ('Is_Zipped', '0'),\n", - ")\n", - "\n", - "with open('modern-1-url.txt', encoding='utf-8') as f:\n", - " data = f.read().strip()\n", - "\n", - "os.makedirs('data', exist_ok=True)\n", - "\n", - "\n", - "import pandas as pd\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "def read(fp):\n", - " df = (pd.read_csv(fp)\n", - " .rename(columns=str.lower) .drop('unnamed: 36', axis=1) .pipe(extract_city_name) .pipe(time_to_datetime, ['dep_time', 'arr_time', 'crs_arr_time', 'crs_dep_time'])\n", - " .assign(fl_date=lambda x: pd.to_datetime(x['fl_date']),\n", - " dest=lambda x: pd.Categorical(x['dest']),\n", - " origin=lambda x: pd.Categorical(x['origin']), tail_num=lambda x: pd.Categorical(x['tail_num']), unique_carrier=lambda x: pd.Categorical(x['unique_carrier']),\n", - " cancellation_code=lambda x: pd.Categorical(x['cancellation_code'])))\n", - " return df\n", - "\n", - "\n", - "def extract_city_name(df:pd.DataFrame) -> pd.DataFrame:\n", - " '''\n", - " Chicago, IL -> Chicago for origin_city_name and dest_city_name\n", - " '''\n", - " cols = ['origin_city_name', 'dest_city_name']\n", - " city = df[cols].apply(lambda x: x.str.extract(\"(.*), \\w{2}\", expand=False))\n", - " df = df.copy()\n", - " df[['origin_city_name', 'dest_city_name']] = city\n", - " return df\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "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.6.8" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -}