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.

Your own environment#

../_images/logo_terminal.svg
  1. Install dependencies

    In the smash directory, 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
    
  2. Build

    Use the make command inside the smash directory:

    make
    
  3. Check your installation

    Once the compilation is complete, make sure that everything went well by tring to import the smash package inside a Python interface:

    python3
    
    import smash
    

Docker#

../_images/logo_docker.png

Warning

Section in development

  1. Build image

    Build docker image:

    docker build --network=host -t smash .
    
  2. 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.