{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "

Tutorial 0. Setup

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This first step to the tutorial will ensure your system is set up to handle all the subsequent sections, with all software installed and all data downloaded as needed. The [index](index.ipynb) provides some links you might want to examine before you start." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```{important} \n", "The instructions below are specific to this tutorial, and are designed to ensure that you install exactly the same versions for which the tutorial was written so that the output shown will exactly match what you see yourself. If you are looking to install a HoloViz package for your own use, please consult each library's website (linked from [HoloViz](https://holoviz.org/)) for detailed guidance. Typically, installing these packages simply involves `conda install` or `pip install`, e.g. `conda install hvplot datashader`.\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```{hint}\n", "If you are attending a live tutorial or workshop and have previously run through the tutorial, make sure to run these steps again shortly before the live session to ensure you have the same version of the tutorial that the presenter will use.\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting set up\n", "\n", "1. **Install conda**:\n", " If you don't have conda installed, you can follow the [conda docs](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) to download and install it. We recommend using the [Miniconda](https://conda.io/miniconda.html) installer.\n", "\n", "2. **Open a new terminal window**\n", " \n", "3. **Create and activate a new conda environment**: This environment is just for `anaconda-project`, a tool to help download the required packages and data for the tutorial.\n", " ```bash\n", " >> conda create -n project \"anaconda-project>=0.11\"\n", " >> conda activate project\n", " ```\n", "\n", "4. **Download and navigate to the tutorial project**: If you've previously run the `anaconda-project download` command below, you may need to delete or rename the pre-existing `holoviz_tutorial` directory.\n", " ```bash\n", " >> anaconda-project download pyviz/holoviz_tutorial\n", " >> cd holoviz_tutorial\n", " ```\n", "\n", "5. **Launch Jupyter**: Don't be alarmed when this command outputs many lines as it downloads packages, sets up another conda environment just for the tutorial, and then launches Jupyter.\n", " ```bash\n", " >> anaconda-project run jupyter lab\n", " ```\n", " Note: You can replace \"lab\" with \"notebook\" if you prefer the original Jupyter notebook interface.\n", "\n", "5. **Test HoloViz imports**:\n", "After launching Jupyter, navigate to this notebook (`tutorial/00_Setup.ipynb`) and run the following cell. This command is a quick check that your environment is set up correctly. You should see the HoloViews, Bokeh, and Matplotlib logos along with a success message.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datashader, panel, hvplot, param, holoviews as hv # noqa\n", "from package_checker import check_packages\n", "hv.extension('bokeh', 'matplotlib')\n", "\n", "packages = ['datashader', 'holoviews', 'panel', 'hvplot', 'param']\n", "check_packages(packages)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "7. **Check datasets**: Finally, run the following cell to make sure the dataset exists and is readable." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from data_checker import check_data\n", "\n", "data_path = '../data/earthquakes-projected.parq'\n", "check_data(data_path)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you don't see any error messages above, you should be good to go! Now that you are set up, you can continue with the [rest of the tutorial sections](01_Overview.ipynb). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 4 }