Skip to content

arizona‐workshop

Ludovico Bianchi edited this page May 18, 2024 · 7 revisions

WaterTAP at University of Arizona

Getting Started

1. Installing Miniconda

Download Miniconda for your system from this website (link). The "latest" version is recommended.

Screenshot 2024-05-18 045710

Run the downloaded installer to start the guided installation process. When prompted to choose options, it is OK to use the default (i.e. already selected) value(s).

Screenshot 2024-05-18 050216

2. Opening a terminal window

Open a terminal window by searching for and running the "Anaconda Prompt (Miniconda3)" program.

Screenshot 2024-05-18 045849

3. Create the Conda environment

At the terminal prompt, run the following command to create the Conda environment that will be used for the tutorial:

conda create --yes --name watertap-arizona -c conda-forge python=3.10 git

Screenshot 2024-05-18 061030

4. Activating the Conda environment

Run the following command to activate the newly created watertap-arizona environment:

conda activate watertap-arizona

The name of the active environment should be shown at the bottom left before the prompt:

Screenshot 2024-05-18 050551

Important

The environment will need to be reactivated every time you need to open another terminal window.

5. Cloning (downloading) the WaterTAP repository locally

Download ("clone") the WaterTAP repository from GitHub by running the following commands:

git clone https://github.com/watertap-org/watertap
cd watertap

Screenshot 2024-05-18 050735

6. Installing the WaterTAP Python package and dependencies

Run the following command to install WaterTAP plus the dependencies needed to run the Jupyter notebook tutorials:

pip install --editable ".[notebooks]"

7. Installing the IDAES solvers

Run the following command to install the IDAES solvers:

idaes get-extensions --verbose

Screenshot 2024-05-18 051313

8. Registering the WaterTAP Conda environment with Jupyter

Run the following command to configure Jupyter to recognize the current WaterTAP environment:

python -m ipykernel install --user --name watertap-arizona

9. Setting a password for Jupyter

Run the following command to set a password for the Jupyter server:

jupyter server password

The password doesn't need to be highly secure, since the Jupyter server runs entirely on your local machine, cannot be accessed from the network, and will only be active for the duration of this tutorial.

10. Starting the Jupyter server

Run the following command to start the Jupyter server from the current directory, specifying the introductory tutorial as the starting notebook:

jupyter lab tutorials\introduction.ipynb

Screenshot 2024-05-18 051839

Depending on your system, a browser window should open up, showing a password prompt. Enter the password chosen in the previous step. After confirming, the Jupyter Lab interface should be shown.

11. Selecting the WaterTAP kernel to use to run the notebook

In the "Select Kernel" pop-up menu, select the watertap-arizona entry (which corresponds to the registration command in Step 8).

Screenshot 2024-05-18 051639

Important

You might have to repeat this selection and/or ensure that the watertap-arizona kernel is being used when launching (opening) other notebooks.

12. Testing the installation

As a way to quickly test if the installation process above was successful, you can run the introduction.ipynb notebook automatically (i.e. not interactively). To do so, select Kernel > Restart Kernel and Run All Cells from the menu bar.

Screenshot 2024-05-18 055659

  • The notebook should take a few minutes to finish running
  • While running, the kernel indicator near the top-right corner will become "busy" (solid gray circle); when finished, it will switch back to the "idle" state (white with gray border)
  • If there are no errors, all the cells of the notebooks should be populated with various outputs
  • If there are errors, error messages (typically in red color) will be shown instead
  • To "reset" the notebook to the initial empty state, select Kernel > Restart Kernel and Clear All Cells from the menu bar

Clone this wiki locally