Repository navigation
HERMES_GR_Installation
This guide explains how to install HERMES_GR using the recommended Conda/Mamba workflow with the project Makefile, and also summarizes the dependencies needed for advanced manual installations.
The recommended installation method creates a complete Conda environment from environment.yml, installs the NES submodule, installs HERMES_GR, configures activation scripts, and runs the basic import and lint tests.
- 0. Requirements
- 1. Clone the repository
- 2. Recommended installation with Makefile
- 3. Verify the installation
- 4. Dependencies
- 5. Advanced manual installation
Before installing HERMES_GR, make sure the following tools are available:
- Git, to clone the repository and its submodules.
- Mamba or Conda, to create and manage the environment.
Mamba is recommended because it usually resolves the environment faster. Conda can also be used through the fallback targets described below.
Clone the HERMES_GR repository with its submodules:
git clone --recurse-submodules https://github.com/BSC-ES/HERMES_GR.git HERMES_GR
cd HERMES_GRThe --recurse-submodules option ensures that all required submodules, including NES, are cloned together with the main repository.
If you already cloned the repository without submodules, initialize them with:
git submodule update --init --recursiveThe repository includes a Makefile that automates the complete installation.
To perform a standard installation using Mamba:
make full_installationBy default, this target:
- Creates a Conda environment in
./HERMES_GR_vX.Y.Z. - Uses
environment.ymlas the source of the Conda dependencies. - Adds the required activation scripts.
- Installs the NES submodule.
- Installs HERMES_GR.
- Runs the basic installation tests.
You can change the parent directory where the environment will be created with CONDA_ENV_DIR:
make full_installation CONDA_ENV_DIR=/my/custom/pathThis creates the environment in:
/my/custom/path/HERMES_GR_vX.Y.Z
After installation, activate the environment with:
conda activate /my/custom/path/HERMES_GR_vX.Y.ZIf CONDA_ENV_DIR is not provided, activate the default local environment with:
conda activate ./HERMES_GR_vX.Y.ZFor development work, use the editable installation target:
make full_installation_for_devThis target creates the environment in:
./HERMES_GR_<your-username>
and installs both NES and HERMES_GR in editable mode.
You can also choose a custom parent directory:
make full_installation_for_dev CONDA_ENV_DIR=/my/dev/pathThis creates the development environment in:
/my/dev/path/HERMES_GR_<your-username>
If Mamba is not available, use the Conda-based targets:
make full_conda_installationFor a developer installation with Conda:
make full_installation_for_dev_condaThe same CONDA_ENV_DIR argument can be used with these targets.
After installation, activate the environment and check that the command-line tools are available.
Check the HERMES_GR version:
hermes_gr -VDisplay the main command help:
hermes_gr -hDisplay the preprocessing command help:
hermes_gr_preproc -hThe installation target also runs the project import and lint tests through the Makefile.
The authoritative dependency file for the recommended installation is environment.yml.
The current HERMES_GR environment is based on:
- Python 3.10
- MPI-enabled
libnetcdf,netCDF4, andh5py mpi4py-
numpy,geopandas,shapely,pyproj,rtree,rasterio, andgdal -
eccodesandpython-eccodes -
configargparse,pyyaml,openpyxl,holidays,pytz,filelock,psutil, andnumba -
pytest,pytest-cov, andpycodestylefor testing and style checks -
jupyterandipykernelfor interactive workflows -
argcomplete, installed throughpip
The requirements.txt file provides a pip-oriented dependency list, while setup.py defines the Python package metadata, install requirements, package data, and console entry points.
The installed console commands are:
hermes_grhermes_gr_preprochermes_sum
Manual installation is only recommended for advanced users who need to adapt HERMES_GR to a custom system or HPC environment.
At minimum, the environment must provide:
- Python 3.10
- A working MPI stack with
mpiccandmpicxx - MPI-enabled NetCDF/HDF5 libraries
- The Python packages listed in
environment.ymlorrequirements.txt
After creating and activating a suitable environment, install NES and HERMES_GR with pip:
python -m pip install hermes_gr/sources/NES
python -m pip install .For development mode:
python -m pip install -e hermes_gr/sources/NES
python -m pip install -e .Avoid using python setup.py install for new installations. The pip install . workflow is the recommended Python packaging interface.