{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## basic Dask_jupyerlab extension demo\n", "see https://www.youtube.com/watch?feature=player_embedded&v=EX_voquHdk0\n", "\n", "If not working, see the how-to: https://github.com/dask/dask-labextension\n", "\n", "You may have, if not working, to re-run;\n", "\n", "
jupyter serverextension enable dask_labextension\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Step 1: launch a Client\n", "\n", "- warning; Dask-Jupyterlab doesn't work for Python-3.9.1, even with Distributed-2020.12.0\n", "- check here for progress on the issue: https://github.com/dask/distributed/issues/4168)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from dask.distributed import Client\n", "import multiprocessing.popen_spawn_win32\n", "client = Client()\n", "client" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## step2 \n", "- click on the DASK Extension (the red pictures) on the left left pannel\n", "- copy the Dashoard url (in blue in the cell above this one) in the DASK DASHBOARD URL ot the Dask Extension panel that appears\n", "- click on the refresh circualr arrow on the left of the bottom CLUSTERS line of the Dask Extension panel\n", "- .... this make the buttons of the DASK extension to go from GREY to ORANGE\n", "- .....clicking on each of them open a dedicated pan with related information: for example \"GRAPH\"\n", "- ..... with jupyterlan you can show it side-to-side with current notebook by moving tabs\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import dask.array as da\n", "\n", "x = da.random.random(((20000 , 20000)), chunks=\"16 Mib\")\n", "x" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "y = (x + x.T) - x.mean(axis=0)\n", "y.sum().compute()" ] }, { "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.9.1" } }, "nbformat": 4, "nbformat_minor": 4 }