Skip to main content

Tipping and Other Abrupt events Detector

Project description

TOAD

TOAD: Tipping and Other Abrupt events Detector

Documentation PyPI version CI Python License
DOI Code style

TOAD is a Python package designed for detecting and clustering spatio-temporal patterns in gridded Earth-system datasets, such as model outputs. The input data should be structured as a 3D array in the format space × space × time, where time can represent actual time or some other forcing variable or bifurcation parameter. TOAD provides a streamlined pipeline for identifying and analyzing spatio-temporal regions or clusters that exhibit similar dynamical responses to external forcing.

Currently, TOAD focuses on identifying regions that experience similar abrupt transitions, such as the sudden loss of ice volume in a specific area. The goal, however, is to expand the package's functionality to support broader use cases, enabling the detection and clustering of diverse types of dynamical shifts across a wide range of systems.

The TOAD pipeline consists of three main components:

  1. Shift Detection: Performs time series analysis at each individual grid cell to identify abrupt transitions or dynamical shifts using configurable detection methods (e.g., ASDETECT) with adjustable sensitivity parameters.
  2. Clustering: Groups the detected shifts spatially and temporally (or along a bifurcation parameter) to reveal cohesive patterns using clustering methods (e.g., HDBSCAN) with configurable space/time scaling.
  3. Aggregation & Synthesis: Aggregates results across multiple cluster maps from different datasets, models, variables, realisations, or methods to produce consensus clusters and statistics, and generates plots and summaries of the identified clusters for insights and interpretation.

TOAD Pipeline

TOAD's core functionality is exposed through the TOAD class, which analyzes netCDF files or xarray datasets. The primary methods - compute_shifts, compute_clusters, and aggregate.cluster_consensus() - handle the three main pipeline steps. The pipeline supports aggregation of results across multiple runs, enabling consensus-based analysis. Additional helper functions and visualization tools make it easy to explore and understand the results.

Installation

PyPI version

$ pip install tipmip-toad

or

$ git clone https://github.com/tipmip-methods/toad.git
$ cd toad
$ pip install .

Simple use case

from toad import TOAD
from toad.shifts import ASDETECT
from sklearn.cluster import HDBSCAN


# init TOAD object with ice-thickness field and a custom time dimension.
td = TOAD("ice_thickness.nc", time_dim="GMST")

# Compute shifts for variable 'thk' using the method ASDETECT (Boulton & Lenton, 2019)
td.compute_shifts("thk", method=ASDETECT(timescale=(0.5, 3.5)))

# Compute clusters using HDBSCAN from scikit-learn (McInnes, 2017)
td.compute_clusters(
    var="thk",
    method=HDBSCAN(min_cluster_size=25),
    time_weight=2.0,
)

# Plot largest clusters in ccrs.SouthPolarStereo() projection
td.plot.overview("thk", map_style={"projection": "south_pole"}, mode="aggregated");
Cluster Overview Example

For more details, check out the tutorials.

Tutorials

Development

$ git clone https://github.com/tipmip-methods/toad.git
$ cd toad
$ pip install -e .[dev]

The -e flag installs the package in "editable" mode, which means changes to the source code are immediately reflected without needing to reinstall.

For more information on contributing, code formatting, and our development workflow, see CONTRIBUTING.md.

Citation

If you use TOAD in your research, please cite:

TOAD package: Harteg, J., Roehrich, L., De Maeyer, K., Garbe, J., Sakschewski, B., Klose, A. K., Donges, J., Winkelmann, R., and Loriani, S.: TOAD: Tipping and Other Abrupt events Detector, Zenodo, https://doi.org/10.5281/zenodo.18316437, 2026.

Note: This DOI always points to the latest release version.

TOAD methodology paper (submitted): Harteg, J., Roehrich, L., De Maeyer, K., Garbe, J., Sakschewski, B., Klose, A. K., Donges, J., Winkelmann, R., and Loriani, S.: TOAD v1.0: A Python Framework for Detecting Abrupt Shifts and Coherent Spatial Domains in Earth-System Data, Geosci. Model Dev., submitted, 2026.

License

TOAD is licensed under the BSD 2-Clause License. See LICENSE.txt for details.

References

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

tipmip_toad-1.0.4.tar.gz (105.7 kB view details)

Uploaded Source

Built Distribution

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

tipmip_toad-1.0.4-py3-none-any.whl (114.9 kB view details)

Uploaded Python 3

File details

Details for the file tipmip_toad-1.0.4.tar.gz.

File metadata

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

File hashes

Hashes for tipmip_toad-1.0.4.tar.gz
Algorithm Hash digest
SHA256 cad4a3332fca6894e6d52fd0279c739973ca08206208be08c7ea63e5b5c803a3
MD5 ee1454612a060bbd5c25a8c3c5dda600
BLAKE2b-256 e6de5b489b07f3265aeaa245a5cc4d4d425b788e7a7a2c94c0095a84bf8335e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tipmip_toad-1.0.4.tar.gz:

Publisher: publish-to-pypi.yml on tipmip-methods/toad

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

File details

Details for the file tipmip_toad-1.0.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for tipmip_toad-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 59b4ecdbe7c8bd8c083331707ee703c5fd06e61a405393f58182079d489215ab
MD5 b9c9188bf74e0f83415c14ba4034f4d6
BLAKE2b-256 26d841ee3d92877ecbb5b5dbbedd83e6875050753b0c476c5b1f41cc555d167c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tipmip_toad-1.0.4-py3-none-any.whl:

Publisher: publish-to-pypi.yml on tipmip-methods/toad

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