{"id":15097660,"url":"https://github.com/ncar/ncar-python-tutorial","last_synced_at":"2025-10-08T02:32:04.179Z","repository":{"id":96025803,"uuid":"173333629","full_name":"NCAR/ncar-python-tutorial","owner":"NCAR","description":"Numerical \u0026 Scientific Computing with Python Tutorial ","archived":true,"fork":false,"pushed_at":"2020-04-02T20:05:44.000Z","size":51826,"stargazers_count":66,"open_issues_count":1,"forks_count":33,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-02T06:03:40.324Z","etag":null,"topics":["cartopy","dask","jupyter","matplotlib","numpy","python","scipy","tutorial","xarray"],"latest_commit_sha":null,"homepage":"https://ncar.github.io/ncar-python-tutorial","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NCAR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-03-01T16:25:17.000Z","updated_at":"2024-09-11T06:42:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"9aa339f4-d8d9-4aba-bb05-406f9cb8d986","html_url":"https://github.com/NCAR/ncar-python-tutorial","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fncar-python-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fncar-python-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fncar-python-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fncar-python-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NCAR","download_url":"https://codeload.github.com/NCAR/ncar-python-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235674061,"owners_count":19027515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cartopy","dask","jupyter","matplotlib","numpy","python","scipy","tutorial","xarray"],"created_at":"2024-09-25T16:24:37.657Z","updated_at":"2025-10-08T02:31:54.765Z","avatar_url":"https://github.com/NCAR.png","language":"Jupyter Notebook","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/NCAR/ncar-python-tutorial/master.svg?style=for-the-badge\u0026logo=circleci)](https://circleci.com/gh/NCAR/ncar-python-tutorial/tree/master)\n\n# NCAR Python Tutorial\n\n- [NCAR Python Tutorial](#ncar-python-tutorial)\n  - [Setup](#setup)\n    - [Step 1: Clone NCAR Python Tutorial Repository](#step-1-clone-ncar-python-tutorial-repository)\n    - [Step 2: Install Miniconda and Create Environments](#step-2-install-miniconda-and-create-environments)\n    - [Step 3: Close and re-open your current shell](#step-3-close-and-re-open-your-current-shell)\n    - [Step 4: Run the Setup Verification Script](#step-4-run-the-setup-verification-script)\n  - [Launch Jupyter Lab](#launch-jupyter-lab)\n    - [1. Cheyenne or DAV via JupyterHub (Recommended)](#1-cheyenne-or-dav-via-jupyterhub-recommended)\n    - [2. Cheyenne or DAV via SSH Tunneling](#2-cheyenne-or-dav-via-ssh-tunneling)\n    - [3. Hobart via SSH Tunneling](#3-hobart-via-ssh-tunneling)\n    - [4. Personal Laptop](#4-personal-laptop)\n\n----\n\n## Setup\n\nThis tutorial covers the installation and setup of a Python environment on:\n\n- Cheyenne\n- Casper\n- CGD's Hobart\n- Personal laptop/desktop with a UNIX-variant Operating System\n\n**NOTE:** For windows users, setup scripts provided in this repository don't work on Windows machines for the time being.\n\n### Step 1: Clone NCAR Python Tutorial Repository\n\nRun the following commmand to clone this repo to your system(e.g. cheyenne, casper, your laptop, etc...):\n\n```bash\ngit clone https://github.com/NCAR/ncar-python-tutorial.git\n```\n\n### Step 2: Install Miniconda and Create Environments\n\n- Change directory to the cloned repository\n\n  ```bash\n  cd ncar-python-tutorial\n  ```\n\n- Run the [`configure`](./setup/configure) script:\n\n  **NOTE**: Be prepared for the script to take up to 15 minutes to complete.\n\n  ```bash\n  ./setup/configure\n  ```\n\n```bash\n$ ./setup/configure --help\nusage: configure [-h] [--clobber] [--download] [--prefix PREFIX]\n\nSet up tutorial environment.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --clobber, -c         Whether to clobber existing environment (default:\n                        False)\n  --download, -d        Download tutorial data without setting environment up\n                        (default: False)\n  --prefix PREFIX, -p PREFIX\n                        Miniconda3 install location)\n```\n\nDefault values for ``--prefix`` argument are:\n\n- Personal laptop / Hobart: `$HOME/miniconda3`\n- Cheyenne or Casper: `/glade/work/$USER/miniconda3`\n\n**NOTE**:\nIn case the default `prefix` is not appropriate for you (due to limited storage), feel free to specify a different miniconda install location. For instance, this install location may be a `project` workspace on a shared filesystem like GLADE or Hobart's filesystem.\n\nThe `configure` script does the following:\n\n- Install `conda` package manager if it is unable to find an existing installation. Otherwise, it will update the `base` environment\n- Create or Update `python-tutorial` conda environment.\n- Download data if not on Cheyenne or Casper or Hobart. If on Cheyenne or Casper or Hobart, create soft-links to an existing/local data repository.\n\n### Step 3: Close and re-open your current shell\n\nFor changes to take effect, close and re-open your current shell.\n\n### Step 4: Run the Setup Verification Script\n\n- Check that *conda info* runs successfully:\n\n  ```bash\n  conda info\n  ```\n\n- From the `ncar-python-tutorial` directory, activate `python-tutorial` conda environment:\n\n  ```bash\n  conda activate python-tutorial\n  ```\n\n- Run the setup verification script to confirm that everything is working as expected:\n\n  ```bash\n  cd ncar-python-tutorial\n  ./setup/check_setup\n  ```\n\n  This step should print **\"Everything looks good!\"**.\n\n----\n\n## Launch Jupyter Lab\n\n### 1. Cheyenne or DAV via JupyterHub (Recommended)\n\n- JupyterHub link: https://jupyterhub.ucar.edu/\n\nTo use the Cheyenne or DAV compute nodes,we recommend using JupyterLab via NCAR's JupyterHub deployment.\n\nOpen your preferred browser (Chrome, Firefox, Safari, etc...) on your ``local machine``, and head over to https://jupyterhub.ucar.edu/.\n\n**You will need to authenticate with either your _yubikey_ or your _DUO_ mobile app**\n\n### 2. Cheyenne or DAV via SSH Tunneling\n\nIn case you are having issues with jupyterhub.ucar.edu, we've provided utility scripts for launching JupyterLab on both Cheyenne and Casper via SSH Tunneling:\n\n```bash\nconda activate base\n./setup/jlab/jlab-ch # on Cheyenne\n./setup/jlab/jlab-dav # on Casper\n```\n\n### 3. Hobart via SSH Tunneling\n\nFor those interested in running JupyterLab on CGD's Hobart, you will need to use SSH tunneling script provided in [``setup/jlab/jlab-hobart``](./setup/jlab/jlab-hobart)\n\n```bash\nconda activate base\n./setup/jlab/jlab-hobart\n```\n\n```bash\n$ ./setup/jlab/jlab-hobart --help\nUsage: launch dask\nPossible options are:\n -w,--walltime: walltime [default: 08:00:00]\n -q,--queue: queue [default: medium]\n -d,--directory: notebook directory\n -p,--port: [default: 8888]\n```\n\n### 4. Personal Laptop\n\nFor those interested in running JupyterLab on their local machine, you can simply run the following command, and follow the printed instructions on the console:\n\n```bash\nconda activate base\njupyter lab\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncar%2Fncar-python-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncar%2Fncar-python-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncar%2Fncar-python-tutorial/lists"}