Installation Guide#
Welcome to the installation guide for the CoastalCodebook! This document provides a step-by-step guide to set up your coastal computing environment; that will mostly use the Jupyter ecosystem combined with other packages maintained by the NumFOCUS project to provide you with an interactive learning experience. Please follow these steps to ensure a smooth start with the tutorial sessions.
1. Setting up Git#
Git is a version control system that we use for managing the course materials. If you’re new to Git, we recommend you to start with this introduction.
Install Git software:
By GitHub Desktop
Follow the GitHub Client documentation to install the GitHub client.
GitHub client does not install the underlying git software on your machine. Follow these instructions to install git on your machine.
By command line
Follow these instructions to install git using the command line.
Fork the repository:
Before you can start working on the project, you’ll need to create a fork of the repository. This will give you a copy of the project in your GitHub account, allowing you to make changes without affecting the original project.
By GitHub Desktop
Go to the CoastalCodebook repository on GitHub.
Click on the “Fork” button at the top right corner of the page to create a copy of the repository in your account.
Once the fork is created, open GitHub Desktop.
Go to File > Clone Repository. Switch to the “URL” tab and paste the URL of your fork of the repository. It will look something like
https://github.com/<yourusername>/CoastalCodebook.git.
, replacing yourusername with your GitHub username.Choose where to clone the repository on your computer and click “Clone”.
By command line
Go to the CoastalCodebook repository on GitHub.
Click on the “Fork” button at the top right corner of the page to create a copy of the repository in your account.
Once the fork is created, open a terminal on your computer.
Clone your fork of the repository by running:
git clone https://github.com/<YOURUSERNAME>/CoastalCodebook.git
, replacing yourusername with your GitHub username.Navigate into the cloned directory:
cd ~/path/to/CoastalCodebook
Following these steps, the repository’s files from GitHub are cloned to your machine. Verify this by navigating to the cloned directory’s path using a file explorer; the contents should mirror those found in the CoastalCodebook repository. However, to interact with and execute the code, we need appropriate software, which we will cover during the installation of a package manager.
2. Installing Mamba Package Manager#
Mamba is a lightweight efficient package manager that we recommend to manage Python environments — if you’re not familiar with managing Python environments, please have a look at this introduction first. Detailed installation instructions for Mamba are available in the Mamba documentation, but here we will share the most important links. In their docs, they refer to the Conda Forge GitHub page to download the software, so that’s where we will download the software as well.
Windows Users
Download and install Mambaforge from the Miniforge GitHub page. Make sure you download the Windows binaries.
You may install miniforge by double-clicking and just using its default settings.
Access and verify Mamba by opening a Miniforge Prompt from the Start menu. You can test if Mamba was installed by running
mamba --version
Known issue: Some users have their firewalls configured in such way that the mambaforge installation is blocked. If you have trouble installing mambaforge, please make sure to temporarily disable your firewall.
Unix-like Systems (Mac and Linux)
Open a terminal. On Mac, search for terminal or iterm in Spotlight. On linux, the hotkey to open a terminal is “cntrl + shift + t”.
The commands to install the package manager are copied from their documentation — double check to see if they are still the correct!
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" bash Mambaforge-$(uname)-$(uname -m).sh
Accept the user agreements, and allow the installation script to edit your profile file because it ensures that the mamba command becomes available in your profile.
3. Creating the software environment#
The tutorial notebooks require specific packages, which we have bundled in a coastal environment to avoid conflicts with other coding projects you may have. In the next steps we will create this environment.
Windows Users
On Windows, open a Miniforge Prompt by searching for “miniforge” in the task bar.
Change to the directory where you cloned the repository. If you installed the GitHub client using their default settings you run
cd%userprofile%\Documents\GitHub\CoastalCodeBook
. By runningDIR
you can see a list of all files and directories. You can also see this in the file explorer by navigating to this directory.The directory contains environment.yml, which is a file that describes the software dependencies. Now create the software environment by running the following command in the terminal/Miniforge prompt:
mamba env create -f environment.yml
Unix-like Systems (Mac and Linux)
On Mac, search for terminal or iterm in Spotlight (command + space). On linux, the hotkey to open a terminal is “cntrl + shift + t”.
You can navigate the terminal using
cd
, which stands for “change directory”. So you would do something likecd ~/path/to/cloned/repository
The repository contains environment.yml, which is a file that describes the software dependencies. Now create the software environment by running the following command in the terminal/Miniforge prompt:
mamba env create -f environment.yml
4. Running the notebooks#
Having successfully installed all necessary content and software on your computer, you’re ready to move forward. The following section will guide you through running thenotebooks!