Network-Based Early Warning System for Hydrological Collapse
Project description
HydroNet: Network-Based Early Warning System for Hydrological Collapse
📋 Overview
HydroNet is an early warning system for hydrological collapse based on multi-domain network analysis using 12 key indicators across climatic, hydrological, infrastructural, and socioeconomic domains. The system provides early warnings with a median lead time of 8.4 months before conventional indicators signal emergency.
🚀 Quick Start
1. Installation
# Clone the repository
git clone https://github.com/emerladcompass/HydroNet.git
cd HydroNet
# Install dependencies
pip install -r requirements-test.txt
- Run Tests
# Test core functionality
python -m pytest tests/test_hydronet.py -v
# Or run all tests
make test-all
- View Research Paper
# Open in browser (HTML version - recommended)
open hydronet.html
# Or view Markdown version
open hydronet.md
📊 Core Package Usage
A. Basic Prediction Example
import numpy as np
from Core_Package.hydronet.extended.predictor import HydroPredictor
# Create sample data
data = {
"precipitation": np.random.normal(0, 1, 100),
"streamflow": np.random.normal(0, 1, 100),
"groundwater_levels": np.random.normal(0, 1, 100),
# ... add all 12 indicators
}
# Predict collapse risk
predictor = HydroPredictor(threshold=0.6)
result = predictor.predict_collapse_risk(data)
print(f"System Vulnerability Index: {result['svi']:.3f}")
print(f"Risk Level: {result['risk_level']}")
print(f"Warning: {result['warning']}")
B. Real-Time Monitoring
from Core_Package.hydronet.extended.monitor import HydroMonitor
# Start monitoring a basin
monitor = HydroMonitor(
basin_name="Colorado River Basin",
update_interval=3600 # seconds
)
# Run monitoring for 24 hours
monitor.run_monitoring(hours=24)
# Generate report
report = monitor.generate_report()
print(report)
🖥️ Command Line Tools
Using Interactive CLI
cd CLI_Tools
python interactive_cli_extended.py
Basic CLI Commands
# Analyze data
python CLI_Tools/interactive_cli.py --analyze --data your_data.csv
# Generate report
python CLI_Tools/interactive_cli.py --report --format html
# Monitor basin
python CLI_Tools/interactive_cli.py --monitor --basin "Nile Basin"
🌐 Web Interface
Run Local Server
cd Web_Interfaces
python web_app.py
# Open browser at: http://localhost:5000
Web Interface Features:
· Interactive dashboard · Network visualization · Real-time updates · Downloadable reports
🔧 Project Structure
HydroNet/
├── hydronet.md # Complete research paper
├── hydronet.html # HTML version
├── Core_Package/ # Core implementation
│ └── hydronet/
│ ├── __init__.py # 12-parameter definitions
│ └── extended/ # Extended implementation
│ ├── hydro_metrics.py # Network metrics
│ ├── predictor.py # Collapse prediction
│ └── monitor.py # Real-time monitoring
├── tests/ # Test suite
│ └── test_hydronet.py # Main tests
├── CLI_Tools/ # Command-line tools
├── Web_Interfaces/ # Web applications
├── Documentation/ # API documentation
└── manuscript/ # Organized manuscript
📈 The 12 Network Indicators
- Climatic Domain: · Precipitation · Evapotranspiration · Atmospheric Pressure
- Surface Water Domain: · Streamflow · Lake Levels · Reservoir Storage
- Groundwater Domain: · Groundwater Levels · Groundwater Quality
- Soil & Land Domain: · Soil Moisture · Land Subsidence
- Human Impact Domain: · Water Extraction · Land Use Change
🔍 Interpreting Results
System Vulnerability Index (SVI)
· 0.0 - 0.4: Low risk · 0.4 - 0.6: Medium risk · 0.6 - 0.8: High risk · 0.8 - 1.0: Critical (requires immediate intervention)
Alert Levels
· LOW: System stable · HIGH: Increased monitoring needed · CRITICAL: Immediate intervention required
🎯 Use Cases
- For Researchers
# Analyze historical data
from Core_Package.hydronet.extended.hydro_metrics import HydroMetrics
metrics = HydroMetrics()
network_density = metrics.network_density(adjacency_matrix)
transfer_entropy = metrics.transfer_entropy(source_data, target_data)
- For Water Managers
# Monitor multiple basins
python CLI_Tools/basin_monitor.py --basins "Nile,Colorado,Indus"
- For Developers
# Develop new features
git checkout -b feature/new-algorithm
# After development
make test-all # Ensure all tests pass
📞 Support & Troubleshooting
Common Issues
# Issue: Circular import
# Solution: Reinstall requirements and run make clean
# Issue: Insufficient data
# Solution: Each indicator needs at least 30 data points
Getting Help
- Open an Issue on GitHub
- Check documentation in Documentation/
- Review test files in tests/ for examples
📚 Additional Resources
Research Paper
· Complete: hydronet.md (13,700 words) · Abstract: manuscript/sections/00_abstract.md · Organized: manuscript/versions/concise_manuscript.md
Detailed Documentation
· Documentation/api_reference.md - API reference · Documentation/extended_parameters.md - Extended parameters
Website
https://emerladcompass.github.io/HydroNet/
✅ Next Steps
- Customize settings in _config.yml
- Add your real data to the project
- Adjust alert thresholds for your needs
- Integrate with external data sources
📊 Performance Metrics
· Prediction Lead Time: 8.4 months (median) · AUC Score: 0.876 · Sensitivity: 82.1% · Specificity: 79.6% · Parameters: 12 network indicators · Paper Length: 13,700 words
🔗 Links
· GitHub Repository: https://github.com/emerladcompass/HydroNet · Live Demo: https://emerladcompass.github.io/HydroNet/ · Research Paper: https://emerladcompass.github.io/HydroNet/hydronet.html
👤 Author
Samir Baladi Emerald Compass Research emerladcompass@gmail.com
📄 License
MIT License - See LICENSE file for details.
HydroNet is ready to use! 🚀
Start with python -m pytest tests/test_hydronet.py to verify everything works, then use the package to analyze your hydrological data.
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 hydronet-1.0.0.tar.gz.
File metadata
- Download URL: hydronet-1.0.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b518952b72a41de9cd0734fee3c74ae50094589bd191d5d744e41b718a36bdbf
|
|
| MD5 |
0c5d110d60086e1d686b122cc95efea4
|
|
| BLAKE2b-256 |
b3d8c4db367cbb98131b809b686cdcdcda69afd618f4d455f3a78a6f72a17f8d
|
Provenance
The following attestation bundles were made for hydronet-1.0.0.tar.gz:
Publisher:
publish.yml on emerladcompass/HydroNet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hydronet-1.0.0.tar.gz -
Subject digest:
b518952b72a41de9cd0734fee3c74ae50094589bd191d5d744e41b718a36bdbf - Sigstore transparency entry: 813067416
- Sigstore integration time:
-
Permalink:
emerladcompass/HydroNet@8fb6dbd2922ae9e76ec446bee22d99c8c9fe352a -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/emerladcompass
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8fb6dbd2922ae9e76ec446bee22d99c8c9fe352a -
Trigger Event:
release
-
Statement type:
File details
Details for the file hydronet-1.0.0-py3-none-any.whl.
File metadata
- Download URL: hydronet-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e321d5824e64645c966f57d069812ab527c976e6c8da55b5020f633fc3b933e
|
|
| MD5 |
13b91ad7af27aad0b1a9f5b41b77d054
|
|
| BLAKE2b-256 |
0a81531925c513b8317352254abb70ca166730b610800566a37da86045d24fc8
|
Provenance
The following attestation bundles were made for hydronet-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on emerladcompass/HydroNet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hydronet-1.0.0-py3-none-any.whl -
Subject digest:
2e321d5824e64645c966f57d069812ab527c976e6c8da55b5020f633fc3b933e - Sigstore transparency entry: 813067444
- Sigstore integration time:
-
Permalink:
emerladcompass/HydroNet@8fb6dbd2922ae9e76ec446bee22d99c8c9fe352a -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/emerladcompass
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8fb6dbd2922ae9e76ec446bee22d99c8c9fe352a -
Trigger Event:
release
-
Statement type: