This repository hosts course materials for a course on computational methods for earth sciences. The course is taught as HWRS640 at the University of Arizona by Dr. Andrew Bennett, but materials are free for all to use to learn, adapt, and remix.
Visit the course website: https://hwrs640.github.io/computational_methods_course/
You may also find the minicamels package useful for working with the CAMELS datasets in Python.
The course materials are organized into the following sections:
- Notebooks: Interactive Jupyter notebooks with code examples and exercises
- Slides: Lecture slides and presentations
- Resources: Additional reading materials and reference guides
- Data: Datasets used throughout the course
- Extras: Supplementary materials and advanced topics
The easiest way to access the course materials is through the published JupyterBook website linked above.
If you want to run the notebooks and work with the code interactively, there are two options:
The easiest way to get a fully configured environment is through GitHub Codespaces. This gives you a cloud-based VS Code editor with all dependencies pre-installed.
- Navigate to the repository on GitHub
- Click the green Code button, then select the Codespaces tab
- Click Create codespace on main
The environment will automatically set up a Python virtual environment, install all dependencies, and register the Python (HWRS640) Jupyter kernel. Once the setup completes, open any notebook in the notebooks/ directory and select the Python (HWRS640) kernel to get started.
To run the notebooks on your own machine you will need Python 3.13+ and uv installed.
-
Clone this repository:
git clone https://github.com/hwrs640/computational_methods_course.git cd computational_methods_course -
Create the virtual environment and install dependencies:
uv venv uv sync
-
Activate the environment and register the Jupyter kernel:
source .venv/bin/activate python -m ipykernel install --user --name hwrs640 --display-name "Python (HWRS640)"
-
Launch JupyterLab:
jupyter lab
Open any notebook in the notebooks/ directory and select the Python (HWRS640) kernel.
To build the course website locally:
-
Clone this repository:
git clone https://github.com/hwrs640/computational_methods_course.git cd computational_methods_course -
Install the required dependencies:
pip install -r requirements.txt
-
Build the book:
jupyter-book build . -
View the built book:
open _build/html/index.html
(On Linux, use
xdg-openinstead ofopen)
Contributions to improve the course materials are welcome! Please follow these steps:
- Fork the repository
- Create a new branch for your changes
- Make your changes and test the build
- Submit a pull request
The JupyterBook is automatically built and deployed to GitHub Pages when changes are pushed to the main branch via GitHub Actions.
This course material is provided for educational purposes.