⚠️ This is the first operational version of the handbook, but it is still a work in progress and will be heavily updated during 2024! ⚠️

How to use risk workflows: command line interface setup

How to use risk workflows: command line interface setup#

The steps below demonstrate how to download the files from one of our workflow repositories, install a suitable Python software environment and start a Jupyter interface to interact with the workflow notebooks. To follow the steps, access to a command line interface (CLI, also known as a terminal or console ) on the computer you are working on is required. Your choice of command line will depend on your operating system (e.g., Windows, MacOS or Linux). Please consult the installation instructions linked below for options that suit your setup.

Note

Alternative applications with a graphical user interface are available for some of the steps taken on the command line below.

See the documentation provided with these tools for up-to-date information on their use.

Download a workflow repository#

We recommend working with git on the command line as it allows not just for conveniently downloadingour workflows but updating and contributing to to them as well.

If you have a few moments, maybe you can be convinced to use git. If you have never used git or don’t have the time for it now, head to the other tab in this section for instructions on how to download the workflows via the GitHub website.

You will need to have git installed to follow the steps below.

Here we show how to download the DROUGHT workflow repository as an example, but you can follow the same steps for any other workflow repository if you replace the hazard name (e.g. FLOODS instead of DROUGHTS).

  1. Open a terminal

  2. Clone the repository with

    git clone https://github.com/CLIMAAX/DROUGHTS.git
    

    or (alternatively) use ssh if you have access configured for your GitHub account:

    git clone git@github.com:CLIMAAX/DROUGHTS.git
    
  3. Move into the cloned directory

    cd DROUGHTS
    
  1. Go to the CLIMAAX GitHub organization and pick the workflow repository for the hazard you want to download, e.g. DROUGHTS.

  2. First click on the <> Code button and then Download ZIP file.

../../_images/download-repo.png
  1. Unzip the file using your favourite tools

  2. Open a terminal inside the unzipped folder

Set up the Python environment#

Every workflow repository contains an environment.yml file for the conda package manager in which all software required to run the workflows in the repository is listed.

  1. In the terminal, check your conda install with

    conda --version
    

    If you find that you don’t have conda available, install it from here.

  2. Create a conda environment from the environment.yml file:

    conda env create -f environment.yml
    

    This creates an new environment called climaax_droughts. The name is defined in the environment file and depends on the hazard. Please check the console output for the exact name of your environment and adapt the name in the next steps if necessary.

  3. To activate the created environment, run

    conda activate climaax_droughts
    

    The input line on your terminal should now begin with (climaax_droughts), indicating that the environment is active.

We also provide a general environment configuration in which all CLIMAAX workflows can run in our workflow template repository.

Start Jupyter and run a workflow notebook#

The environment.yml files from our workflow repositories contain both the JupyterLab and Jupyter Notebook interfaces. With the conda environment from the previous step activated (see above), launch your preferred Jupyter interface in the conda environment:

jupyter lab

or (alternatively)

jupyter notebook

The interface is served in the browser, which should open automatically. Otherwise use the link printed to the console to open. The interface will present the contents of the folder from which Jupyter was launched. Workflow notebooks can be started there and edited and run interactively in the browser.