Skip to main content

SPHERE: Spatial Platform for Hazard Evaluation and Risk Estimation

Open in molab 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.

Metadata

Release files for niyamit-sphere 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 niyamit-sphere 0.2.0
File Size Uploaded
niyamit_sphere-0.2.0.tar.gz 64.9 kB Details

Built distribution (wheel)

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

Total release size: 68.3 kB

Release files / niyamit_sphere-0.2.0.tar.gz

Download URL niyamit_sphere-0.2.0.tar.gz
Size 64.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f3fdc45c73fd09b9ec7eb4e6693275cc96ff5ef3dfe1eddfe80285bbfb2158e6
BLAKE2b-256 checksum
How to use checksums
ae90a7cb7a0bfdb34ae9268eda998356c9ffa447ca19fa230e3ed00260920196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

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

Download URL niyamit_sphere-0.2.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0000108c880716ab3f03f2f5828e11e220a01d757be744220eccf5237c0017d7
BLAKE2b-256 checksum
How to use checksums
a24886a1ed3f24e4dbde40723f302e9fcc8e03df5e8e442ec0720053f95bd239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.43

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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