A modern Python implementation of HAZUS flood methodology for building vulnerability and loss estimation.
Project description
sphere
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
- Create a virtual environment (Python 3.10+).
uv sync --all-packages
- Run tests
uv run pytest -q
- 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
PYTHONPATHso imports likeimport sphere.coreresolve 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 toGITHUB_ENVso 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file niyamit_sphere-0.1.1.tar.gz.
File metadata
- Download URL: niyamit_sphere-0.1.1.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a049da31d55777bc53b567baa60d7cba7bc53692de60203943011171349fb352
|
|
| MD5 |
3c9684e822e09ac997a00225f08d63e3
|
|
| BLAKE2b-256 |
f272191b4b8babd4d85c23ed2d7ead921c39a7eed605b01409f3e5165ce48a51
|
File details
Details for the file niyamit_sphere-0.1.1-py3-none-any.whl.
File metadata
- Download URL: niyamit_sphere-0.1.1-py3-none-any.whl
- Upload date:
- Size: 70.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0eeafc4c3b5ad9f849901953e818dee1a6698807ab009b72b3c75f92d8f611de
|
|
| MD5 |
38ad1bff03c7c3ca4e932744c999e30b
|
|
| BLAKE2b-256 |
d6e24b0888b83bf4e947e649197316fd4fef47853686bda58c6a2af3921c0e4d
|