Skip to main content

quakecascade

Earthquake scenario cascades for cities: ground motion, building damage, casualties and shelter need, liquefaction, debris-induced road closure, accessibility to emergency services, relief-depot allocation, unit ranking and lifeline repair demand, computed on open or municipal inventories.

fault + magnitude ─► ground motion (ASB2014) ─► damage at bracketing design levels (Hazus 6.1)
   ─► casualties, displaced households, shelter ─► liquefaction screen (Zhu 2015 / Hazus)
   ─► Monte Carlo bands with shared ground-motion residuals
   ─► debris reach, pressure, corridor blockage, navigable core ─► closed roads
   ─► travel times before/after ─► isolation status, 2SFCA access
   ─► p-median depots, capacity balance ─► TOPSIS unit ranking ─► pipeline repairs

quakecascade re-implements, as open source, the methods of DİRİ, the earthquake decision-support platform built for the İzmir Earthquake Master Plan. It contains none of DİRİ's code and no data of İzmir Metropolitan Municipality (İBB) or any other city: everything runs on inputs you supply, on open data, or on the built-in synthetic town.

Why another earthquake package

Loss engines stop at buildings and lifelines, while accessibility and location-allocation tools assume the street network is intact. quakecascade connects the two in one library, under rules that keep the chain honest:

  • Missing is never zero. Each value comes with a status code (computed, partial, no_vs30, outside_envelope, …), and an unknown street is never reported as a safe one.
  • No silent defaults. Every coefficient cites its source. A planning choice without a published value, such as the debris spread factor or the closure threshold, is a required argument.
  • Counts sum, intensities do not. Aggregation follows the nature of each column.
  • Reproducible. A cascade run returns a manifest with its parameters, input digests and a fingerprint.

Install

pip install quakecascade                  # core: numpy, scipy, pandas, shapely, pyproj
pip install "quakecascade[demo,raster]"   # + geopandas, osmnx, matplotlib, rasterio for the examples
pip install "quakecascade @ git+https://gitlab.com/yusufeminoglu/quakecascade.git"   # development version

Python 3.10 or newer is required. Documentation: https://quakecascade-57b9f4.gitlab.io/

Quick start

import numpy as np
from quakecascade import fragility, groundmotion as gm

trace = np.array([[0.0, 0.0], [30_000.0, 0.0]])           # metres, projected CRS
rupture = gm.FaultGeometry.from_wells_coppersmith(
    dip_deg=60.0, dip_azimuth_deg=0.0, magnitude=6.8, mechanism="NS",
    source="hypothetical example fault, dip 60 deg to the north")
sites = np.array([[15_000.0, 5_000.0], [15_000.0, 12_000.0], [15_000.0, 40_000.0]])
vs30 = np.array([300.0, np.nan, 760.0])                    # the second site has no Vs30

motion = gm.scenario(sites, vs30, trace, magnitude=6.8, mechanism="NS", geometry=rupture)
dmg = fragility.damage(motion["pga_g_p50"].to_numpy(), ["C1M", "C1M", "URML"],
                       floors=[5, 5, 2], design_levels=["pre", "moderate"])
print(dmg[["building_id", "design_level", "p_complete", "dmg_status"]].round(3))
   building_id design_level  p_complete          dmg_status
0            0          pre       0.519            computed
1            1          pre         NaN              no_pga
2            2          pre       0.006            computed
3            0     moderate       0.138            computed
4            1     moderate         NaN              no_pga
5            2     moderate         NaN  no_fragility_curve

The examples run the whole chain:

python examples/01_synthetic_town.py           # every stage on a synthetic town
python examples/02_open_data.py                # a real area from open data (network; demo, raster)
python examples/03_realisations_and_gis.py     # closures over many collapse draws, GeoPackage
python examples/04_external_ground_motion.py   # the modules chained on external ground motion

Modules

Module Computes
groundmotion Joyner–Boore distance to a dipping rupture plane; PGA, PGV and SA percentiles from Akkar, Sandıkkaya & Bommer (2014)
fragility Hazus 6.1 damage-state probabilities at several design levels
impact casualties by severity and time of day, displaced households, public shelter need (Hazus 6.1)
montecarlo city-total damage bands under independent, between-event and fully correlated sampling
liquefaction, hydro Zhu et al. (2015) geospatial liquefaction, Hazus susceptibility, CTI from a DEM
debris debris reach, road pressure, blocked corridor share, navigable core, closed roads
network routable road network with SciPy or pure-NumPy shortest paths
access isolation status, nearest-facility time, 2SFCA and Hansen accessibility
allocate p-median depot location and capacity-balanced allocation
mcda TOPSIS ranking
lifelines buried pipeline repair rates and counts
cascade the whole chain as one run, with a stage log and manifest
datasets synthetic demonstration town; OSM, Copernicus DEM and GEM fault fetchers
contract, crs status codes, column specifications, aggregation rules, metric-CRS checks

Each module has a method page under docs/methods/ with its equations, parameter tables, sources and caveats, published at https://quakecascade-57b9f4.gitlab.io/. Build the site locally with pip install -e ".[docs]" && mkdocs serve.

Scope and limits

Fragility, casualty and shelter tables are Hazus calibrations of US practice. Ground motion uses one model, derived from European and Middle Eastern records. Debris parameters are not calibrated against observations, so bracket them. The package is a scenario tool for planning and teaching. It does not produce probabilistic seismic hazard and is not a substitute for a site-specific engineering assessment.

Development

python -m pip install -e ".[test]"
python -m pytest -q                               # 600+ tests, no network
QUAKECASCADE_FORCE_NUMPY=1 python -m pytest -q    # pure-NumPy paths
ruff check src tests

See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

Licence and citation

BSD-3-Clause (see LICENSE). Third-party material, such as the ASB2014 coefficient table from pyGMM (MIT), is listed in NOTICE. To cite the software, see CITATION.cff.

Metadata

Release files for quakecascade 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quakecascade 0.2.0
File Size Uploaded Provenance Actions
quakecascade-0.2.0.tar.gz 447.1 kB Without provenance Details for quakecascade-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quakecascade 0.2.0
File Interpreter ABI Platform Actions
quakecascade-0.2.0-py3-none-any.whl Python 3 none any Details for quakecascade-0.2.0-py3-none-any.whl

Total release size: 606.5 kB

Release files / quakecascade-0.2.0.tar.gz

Download URL quakecascade-0.2.0.tar.gz
Size 447.1 kB
Tags Source
SHA-256 checksum
How to use checksums
25eb10850aa5fbc49de3ac797fa9c17a418afeca6955011bd5bab8b8be783b35
BLAKE2b-256 checksum
How to use checksums
bf60e8cebe39c1d78a0bf8ef84b441b785eb9965d14fa612ed6f5e5fe346c931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / quakecascade-0.2.0-py3-none-any.whl

Download URL quakecascade-0.2.0-py3-none-any.whl
Size 159.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4700c092dda44612615424334223d78b09fcc4602f960fc40e0716a00d8d43f9
BLAKE2b-256 checksum
How to use checksums
28347c2f0e9fcfe2d75f36144d2a1ca592afe405b61c8895166f6f184b26fae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.18

Security for quakecascade 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page