Developer Guide

The Floodwater system is written in a combination of Python and shell scripts. The code is organized into the following structure:

Floodwater/
    core/
        cli/
        system/
            ecf/
            include/
            postproc/
            scripts/
    data_services/
    data_transform/
    messaging/
    models/
        adcirc/
        hecras/
    scripts/

The directory tree is installed based on the specification in the pyproject.toml. Code that runs on the command line is generally installed in the cli directory.

Installation

When the Floodwater system is installed manually, the install.py command can be used. This command will generate an Anaconda environment and use pip to install the Floodwater system.

Pre-commit

The Floodwater system uses the pre-commit package to run a series of checks on the code before it is committed. This is done to ensure that the code is formatted correctly and that there are no obvious errors. The pre-commit hooks can be installed by running the initialize_development.sh script. Currently, the only command in the file is pre-commit install however, the file is left in place in case additional commands are needed in the future.

The following checks are run by pre-commit:

  • black

  • ruff

  • check-yaml

  • end-of-file-fixer

  • trailing-whitespace

Configuration for the pre-commit checks is stored in the .pre-commit-config.yaml file and pyproject.toml file.