Installation
If you would like to use SCAHpy for your own datasets and run it on a local machine or server, you will need to download and install it first.
Required dependencies:
- Python >= 3.9
- xarray
- wrf-python
- netCDF4
- Dask
Optional dependencies:
For optimal performance, it is highly recommended that you install the following dependencies:
Step-by-step instructions
These instructions should function in most operating systems, including Windows, macOS, and Linux, as Conda
and Miniforge
are designed to be cross-platform. However, there might be slight differences in the installation process or command syntax depending on the operating system.
To ensure clarity and compatibility across all operating systems, consider the following:
- Windows:
- Users might need to open the terminal or command prompt as an administrator to execute some commands.
- Paths in the terminal should use backslashes (
\
) instead of forward slashes (/
).
- macOS:
- Users may need to install command-line developer tools if they haven’t done so already. This can be done by running
xcode-select --install
in the terminal. - Ensure that users have permission to execute scripts and install packages.
- Users may need to install command-line developer tools if they haven’t done so already. This can be done by running
- Linux:
- Some Linux distributions might require additional dependencies or configurations for Conda or Miniforge to work properly. It’s advisable to consult the documentation specific to the Linux distribution being used.
Using Conda
Download and Install Miniforge:
Before installing
scahpy
, you need to ensure that you have Conda installed on your system. Miniforge is a minimal distribution of Conda that includes essential tools for package management.Go to the Miniforge GitHub page and follow the instructions to download and install Miniforge suitable for your operating system.
Create a New Conda Environment and Install SCAHpy:
Once Conda is installed, you can create a new Conda environment specifically for
scahpy
and its dependencies. To do this, you’ll use an environment file calledenvironment.yml
, which contains a list of packages and their versions required forscahpy
to function properly.Download the
environment.yml
file from the SCAHpy GitHub repository.Open a terminal or command prompt and navigate to the directory where the
environment.yml
file is located.Run the following command to create a new Conda environment named
scahpy_env
and install all the packages listed in theenvironment.yml
file:conda env create --file environment.yml -n scahpy_env
This command will create a new Conda environment named
scahpy_env
and install all the required dependencies listed in theenvironment.yml
file into this environment.Once the environment is created, activate it using the following command:
conda activate scahpy_env
By following these steps, you’ll have scahpy
and all its dependencies installed and ready to use in your Conda environment.
Using Mamba
Download and Install Mamba: Before installing
scahpy
, you need to ensure that you have Mamba installed on your system. Mamba is a package manager for Conda environments and can be installed via Miniforge, which is a minimal distribution of Conda that includes Mamba.- Go to the Miniforge GitHub page and follow the instructions to download and install Miniforge suitable for your operating system.
Install SCAHpy and Dependencies:
The easiest and recommended way to install
scahpy
along with its required dependencies is by using an environment file calledenvironment.yml
. This file contains a list of packages and their versions that are needed forscahpy
to function properly.Download the
environment.yml
file from the SCAHpy GitHub repository.Open a terminal or command prompt and navigate to the directory where the
environment.yml
file is located.Run the following command to create a new Conda environment named
scahpy_env
and install all the packages listed in theenvironment.yml
file:mamba env create --file environment.yml -n scahpy_env
This command will create a new Conda environment named
scahpy_env
and install all the required dependencies listed in theenvironment.yml
file into this environment.
By following these steps, you’ll have scahpy
and all its dependencies installed and ready to use in your Python environment.
Using pip
First, ensure you have Python and pip installed on your system. You can download and install Python from the official Python website, which usually includes pip by default.
The easiest way to install
scahpy
and its dependencies is by creating a virtual environment and installing from a requirements file. Open a terminal or command prompt, then run the following commands:
# Create a virtual environment (optional but recommended)
python -m venv scahpy_env
# Activate the virtual environment
# On Windows
scahpy_env\Scripts\activate
# On macOS/Linux
source scahpy_env/bin/activate
# Install scahpy and dependencies from requirements.txt
pip install -r requirements.txt
In this example, requirements.txt
is a file containing a list of dependencies including scahpy
. You would need to provide or generate this file yourself, listing all necessary packages and their versions: wrf-python, netCDF4, xarray, numpy, pandas, matplotlib, cartopy, geopandas, datetime, scahpy
.