Skip to main content

A modern Python implementation of HAZUS flood methodology for building vulnerability and loss estimation.

Project description

SPHERE: Spatial Platform for Hazard Evaluation and Risk Estimation

Click the link to run the sample in Google Colab! Open In Colab

A modern Python implementation of the HAZUS flood methodology for building vulnerability and loss estimation. This repository packages a set of libraries (sphere-core, sphere-data, sphere-flood) that implement flood vulnerability functions, lookup tables, and analysis scripts suitable for research and operational use.

This project is a newer reimplementation of HAZUS flood vulnerability logic with a focus on clarity, type annotations, and tested, modular code.

Key features

  • Building vulnerability functions (HAZUS-derived)
  • Flood damage cross-reference and interpolation utilities
  • Example analysis scripts in examples/
  • Test coverage under tests/

License This code is released under the MIT License — see LICENSE for details.

Quick start

  1. Create a virtual environment (Python 3.10+).
uv sync --all-packages
  1. Run tests
uv run pytest -q
  1. Explore examples in the examples/ directory.
uv run examples\fast_analysis.py

Contributing Please see CONTRIBUTING.md for guidelines on reporting issues, proposing changes, running tests, and contributing patches. All contributors must agree to the project's MIT license by submitting pull requests.

Contact For questions and larger design discussions, please open an issue on the project GitHub repository.

Development

There are two convenient ways to work with the workspace packages locally:

  • Lightweight dev environment using PYTHONPATH (recommended for quick development):

    • Linux/macOS:

       source scripts/dev.env
       uv run pytest -q
      
    • Windows PowerShell:

       .\scripts\dev.env.ps1
       uv run pytest -q
      

    This sets PYTHONPATH so imports like import sphere.core resolve against the in-repo sources without installing packages into your virtualenv.

-- Meta package (sphere-meta): a minimal aggregator distribution that depends on sphere-core, sphere-data, and sphere-flood. You can build and install libs/sphere-meta if you want a single installable package that pulls the three distributions from PyPI.

```powershell
cd libs/sphere-meta
uv run python -m build -w
python -m pip install dist\sphere_meta-0.1.0-py3-none-any.whl
```

CI notes

In CI, prefer one of these two approaches:

  • Set PYTHONPATH (fast): add the paths to GITHUB_ENV so tests can import the in-repo packages.
  • Build wheels for each package and install them (strict): build and install wheels in the job before running tests.

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

niyamit_sphere-0.1.43.tar.gz (64.7 kB view details)

Uploaded Source

Built Distribution

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

niyamit_sphere-0.1.43-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file niyamit_sphere-0.1.43.tar.gz.

File metadata

  • Download URL: niyamit_sphere-0.1.43.tar.gz
  • Upload date:
  • Size: 64.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for niyamit_sphere-0.1.43.tar.gz
Algorithm Hash digest
SHA256 61d50703c9ddcfd01ffea82099abec4c585ce4ee26d3295c95627e6cbaa3764d
MD5 a9bc0ee21b740214194b3107c94a8764
BLAKE2b-256 8b8c1b508d4a76cbaae8e0dd89e8dd73cce9652a343a4659f0244fc6926e0953

See more details on using hashes here.

File details

Details for the file niyamit_sphere-0.1.43-py3-none-any.whl.

File metadata

File hashes

Hashes for niyamit_sphere-0.1.43-py3-none-any.whl
Algorithm Hash digest
SHA256 d052755d1b6eb9b24f13c2a2a61a401945a188bbbce240dec9c9b5394d115582
MD5 e705d1c95f215b0fc1c76e75be8ad9bd
BLAKE2b-256 6719ceb6e8df47c9f60f975af8efbf93f1366d5edfcdd51216b511c6b3b9b831

See more details on using hashes here.

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