Skip to main content

A software package support system which can be used to assess the benefits and costs of flood resilience measures

Project description

FloodAdapt

FloodAdapt is a decision-support tool that seeks to advance and accelerate flooding-related adaptation planning. It brings rapid, physics-based compound flood and detailed impact modelling into an easy-to-use system, allowing non-expert end-users to evaluate a wide variety of compound events, future conditions, and adaptation options in minutes. FloodAdapt serves as a connector between scientific advances and practitioner needs, improving and increasing the uptake and impact of adaptation research and development.

To make decisions on flood adaptation, communities need to understand how climate and socio-economic changes will affect flood risk and the risk-reduction potential of various adaptation options. This type of information is usually costly to acquire, and models are often too slow and labor-intensive to evaluate all the scenarios required to understand the impacts and effectiveness of potential adaptation decisions. FloodAdapt addresses this by making rapid, physics-based compound flood modeling and detailed impact modeling accessible to non-expert end-users, allowing them to evaluate a wide variety of compound events, future conditions, and adaptation options in minutes.

FloodAdapt was developed as a rapid planning tool with a straightforward graphical user interface for scenario generation, simulation, and visualization of spatial flooding and flooding impacts. Decision-making needs at the community level were central to the design of FloodAdapt. Users can answer planning questions like: “How will potential adaptation options reduce flood impacts?”, “How will those options perform for different types of events, like hurricanes, king tides, or heavy rainfall?”, “Which neighborhoods will benefit most?”, “How will those options hold up in the future?”

Users specify what-if scenarios composed of historic or synthetic weather events, climate or socio-economic future projections, and adaptation measures. The backend of FloodAdapt leverages the open-source, state-of-the-art process-based compound flood model SFINCS (https://github.com/Deltares/SFINCS) that can accurately predict compound flooding due to surge, rainfall, and river discharge, at a fraction of the computation time typically required by physics-based models. The damage model included in FloodAdapt is the Deltares-developed flood impact assessment tool Delft-FIAT (https://github.com/Deltares/Delft-FIAT). It calculates the flood damages to individual buildings and roads, and – when social vulnerability data is available – aggregates these damages over vulnerability classes.

FloodAdapt can greatly support adaptation planning by allowing users to explore many scenarios. It can be used to evaluate flooding and impacts due to compound weather events, like hurricanes, king tides, and rainfall events. Users can evaluate flooding, impacts, and risk considering user-specified projections of sea level rise, precipitation increase, storm frequency increase, population growth, and economic growth. Users can also test out adaptation options, like sea walls, levees, pumps, home elevations, buyouts and floodproofing.

Recent developments of the decision-support system include (1) simplifying and partially automating the setup of the SFINCS and Delft-FIAT models, (2) improving the user experience, (3) better supporting adaptation planning with improvements like metrics tables, infographics, better visualizations in the user interface, adding in additional adaptation options to evaluate, and calculating benefits of adaptation options, and (4) incorporating social vulnerability and equity into the evaluation of adaptation options to support equitable adaptation planning.

FloodAdapt is currently in an intensive development stage. Independent usage of the repository will be challenging prior to end-of-year 2024. FloodAdapt documentation will be expanded on throughout 2024.

Installation

Setting up Pixi

To build the environment, manage dependencies and run tasks, FloodAdapt uses Pixi, please download and install it by following the instructions on the pixi website.

Before continuing the installation process, make sure you have access to all required private repositories by ensuring you are in the Teams FloodAdaptUsers in the Deltares and Deltares-research organizations.

Windows

Then run these commands to install FloodAdapt:

git clone https://github.com/Deltares-research/FloodAdapt.git
cd FloodAdapt
pixi install

Linux

Linux is not supported at the moment, but will be supported in the near future.

Configure database

TODO add section for the DatabaseBuilder.

FloodAdapt uses a database to store, handle and organize input files, output files and static data. This database needs to be configured the first time you want to use FloodAdapt. Which is done via flood_adapt/misc/config.py which contains the Settings class to set and validate environment variables, specific to your system.

To initialize FloodAdapt and configure the database, add the following lines to the top of your script / initialize function to validate and set the environment variables:

from pathlib import Path
from flood_adapt import Settings

# Usually ends in `Database` and can contain multiple sites
root = Path("path/to/your/database/root")

# Specifies which site to use
name = "database_name"

# Define the paths to the model kernel binaries
sfincs_bin = Path("path/to/your/sfincs/bin.exe")
fiat_bin = Path("path/to/your/fiat/bin.exe")

# Validate and set environment variables
Settings(
    DATABASE_ROOT=root,
    DATABASE_NAME=name,
    SFINCS_BIN_PATH=sfincs_bin,
    FIAT_BIN_PATH=fiat_path,
    VALIDATE_BINARIES=True,
)

Developing FloodAdapt

To contribute to FloodAdapt, you will need to install additional dependencies. To do so, clone the repository and install the development environment:

# Install dev environment
git clone https://github.com/Deltares/FloodAdapt
cd FloodAdapt

# This will install the required environment and run the tests to verify
pixi run tests

Alternatively, you can open an interactive shell and have pixi take care of activating and updating your environment.

# `activate` the dev environment
pixi shell -e dev

# Develop
pytest tests/test_x/test_y/test_z.py
python scripts/my_script.py
...

Adding editable installations to your environment

To make developing easier and not have to reinstall packages after every change, editable installs exist. Pixi supports editable installs, but not in the most intuitive way, as they need to be defined as editable in the project specification.

Example command to add the package example_package as an editable install to the default environment:

  • go to the non-pixi sections in pyproject.toml and comment out the example_package. ([dependencies] or [optional-dependencies])
  • in the pixi section [tool.pixi.pypi-dependencies]: add the following line example_package = {path = "./path/to/example_package", editable = true }. Note that this path is relative to the root of this project.
  • run pixi update

Useful pixi commands

# Display all pixi commands and options
pixi -h

# Install a non default pixi environment defined in pyproject.toml
pixi install -e [ENV_NAME]

# Update environment(s) to the latest allowed by dependency specifications in pyproject.toml
pixi update

# List all available tasks
pixi task list

# Run a task in the default environment for that task
pixi run [TASK]

# Start a shell in the pixi environment
pixi shell -e [ENV_NAME]

# Add a package to the dependencies
pixi add [PACKAGE]

# Run a task in a specific environment
pixi run -e [ENV_NAME] [TASK]

Generating the documentation

We use quartodoc to generate our API documentation automatically. If you have the docs optional dependency group installed. you can do this by running quartodoc build from the docs directory, and it will create the documentation for you. After this is done, if you wish, you can build and view the documentation locally by running quarto preview from the docs directory

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flood_adapt-1.0.5.tar.gz (315.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flood_adapt-1.0.5-py3-none-any.whl (345.5 kB view details)

Uploaded Python 3

File details

Details for the file flood_adapt-1.0.5.tar.gz.

File metadata

  • Download URL: flood_adapt-1.0.5.tar.gz
  • Upload date:
  • Size: 315.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flood_adapt-1.0.5.tar.gz
Algorithm Hash digest
SHA256 daa0153cfa9a90651dba5f5e2d39f014683b072198a933c9ecb948f3ed02f0ee
MD5 2de554d6d142ab43cf214b02b59cae59
BLAKE2b-256 1dbc5c3c9c560781fbbe23d2e81a44dcaa3e09c30fdf3cfc017410c120c4a166

See more details on using hashes here.

Provenance

The following attestation bundles were made for flood_adapt-1.0.5.tar.gz:

Publisher: publish-to-pypi.yml on Deltares-research/FloodAdapt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flood_adapt-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: flood_adapt-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 345.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flood_adapt-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e122d3573efc8a0957882bec38cd23984433529dd12a060a29a6c42a52b8dc60
MD5 8c192fbf65bcbb63a1317e437bb7c7f2
BLAKE2b-256 86e2c7c712449cdd8d390467378fc127988b376dc93ef730be82d2331eeac7b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for flood_adapt-1.0.5-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Deltares-research/FloodAdapt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page