Getting Started#
Installation#
smash can be used on Linux and is compatible with most distributions. It has been tested for use on Ubuntu 20.04 and 22.04 LTS, and supports Python versions 3.8 to 3.11.
The installation instructions are detailed for Ubuntu. Depending on your distribution, you will need to use the correct package manager and insert the appropriate packages.
First, clone the Git repository:
git clone https://github.com/DassHydro-dev/smash.git
and navigate to the working directory:
cd smash
Now you can proceed with building the code and installing dependencies. You have multiple options, such as using Anaconda, your own Python environment, or Docker.
Anaconda (recommended)#
- Create environment
In the
smashdirectory, create a conda environment named smash:conda env create -f environment.yml
- Activate environment
Activate the environment:
conda activate smash
- Build
Use the make command inside the
smashdirectory:(smash) make
- Check your installation
Once the compilation is complete, make sure that everything went well by tring to import the
smashpackage inside a Python interface:(smash) python3
import smash
Hint
If you’d prefer that conda’s base environment not be activated on startup, set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Your own environment#
- Install dependencies
In the
smashdirectory, install development tools and Python requirements:sudo apt-get update sudo apt-get install build-essential make gcc gfortran gdal-bin libgdal-dev python3-pip pip3 install -r requirements.txt
- Build
Use the make command inside the
smashdirectory:make
- Check your installation
Once the compilation is complete, make sure that everything went well by tring to import the
smashpackage inside a Python interface:python3
import smash
Docker#
Warning
Section in development
- Build image
Build docker image:
docker build --network=host -t smash .
- Run
Run image:
docker run smash
Tutorials#
For a brief user guide to get started with smash, you can refer to the Quickstart section in the User Guide. Other in-depth functionalities and advanced optimization techniques are also included in this User Guide.
For detailed descriptions of the smash API, you can visit the API Reference section.
Additionally, if you’re interested in the mathematical and numerical documentation of the hydrological model operators and the optimization problems, you can refer to the Math/Num Documentation section.