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

git clone https://gitlab.com/yusufeminoglu/quakecascade.git
cd quakecascade
python -m pip install -e .            # core: numpy, scipy, pandas, shapely, pyproj
python -m pip install -e ".[demo]"    # + geopandas, osmnx, matplotlib for the examples

Python 3.10 or newer is required. The package is not on PyPI yet.

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"]])
   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 whole chain on the synthetic town, and on open data for a small area (network required):

python examples/01_synthetic_town.py
python examples/02_open_data.py        # needs the demo and raster extras

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. Build the documentation site 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.1.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.1.0
File Size Uploaded Provenance Actions
quakecascade-0.1.0.tar.gz 368.5 kB Without provenance Details for quakecascade-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 523.0 kB

Release files / quakecascade-0.1.0.tar.gz

Download URL quakecascade-0.1.0.tar.gz
Size 368.5 kB
Tags Source
SHA-256 checksum
How to use checksums
59ec2c0689996fa968b0ffdc22176ae3297d0e7e0ccc6c9fd377320b3bd36ece
BLAKE2b-256 checksum
How to use checksums
59f21a84e6d1e897010321488f65fa5399359fa95d1e81d91db7473315ac9d8c
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.1.0-py3-none-any.whl

Download URL quakecascade-0.1.0-py3-none-any.whl
Size 154.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42ba1dfcaf4c299c26181d105b2fc4ebdee25e4c8b0c6d215bf3d9f6fda7c0c8
BLAKE2b-256 checksum
How to use checksums
410c83d98983dc90ef1954f2800002771e82674252fe041e18daec7175de08d4
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.1.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.1.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