Installation¶
We strongly recommend using a virtual environment to manage dependencies and avoid package conflicts.
Requirements¶
- Python: 3.10 or higher
- Operating System: Windows, Linux, or macOS
- Dependencies: Automatically installed with pip (xarray, netCDF4, pandas, numpy, pint, AquaFetch, etc.)
For Users¶
Using uv (Recommended)¶
We recommend using uv for fast, reliable package and environment management:
1 2 3 4 5 | |
This installs the latest stable release along with all required dependencies, significantly faster than traditional pip.
Using pip (Alternative)¶
If you prefer traditional pip:
1 2 3 4 5 6 | |
Using conda¶
If you prefer conda, you can install from conda-forge:
1 2 3 4 5 6 | |
Verify Installation¶
After installation, verify it works:
1 | |
For Developers¶
If you want to contribute to hydrodataset or modify the source code, follow these steps:
Using uv (Recommended)¶
This project uses uv for fast, reliable package and environment management:
1 2 3 4 5 6 7 8 9 | |
The --all-extras flag installs:
- Base dependencies (required for core functionality)
- Development tools (pytest, black, flake8, etc.)
- Documentation tools (mkdocs, mkdocstrings, etc.)
Using pip (Alternative)¶
If you prefer traditional pip:
1 2 3 4 5 6 7 8 9 10 | |
Verify Development Installation¶
1 2 3 4 5 6 7 8 9 10 11 | |
Post-Installation Setup¶
Create Configuration File¶
After installation, create a hydro_setting.yml file in your home directory:
Windows: C:\Users\YourUsername\hydro_setting.yml
Linux/Mac: ~/hydro_setting.yml
Content (local only):
1 2 3 4 | |
For cloud access, add the s3 block (used by source="cloud"):
1 2 3 4 5 6 7 | |
storage.s3.* contains credentials — never commit it to a repository.
Important: Update the paths according to your system. Ensure:
- The root directory already exists — local path resolution (source="local") fails if it does not
- You have write permissions
- Sufficient disk space (raw data + NetCDF cache can be several GB per dataset)
Download Data¶
hydrodataset uses AquaFetch to fetch raw data. Some datasets download automatically, while others require manual download. Check the AquaFetch documentation for dataset-specific instructions.
Troubleshooting¶
pip installation fails¶
If you encounter errors during installation:
1 2 3 4 5 | |
Import errors after installation¶
1 2 3 4 5 6 | |
AquaFetch dependency issues¶
hydrodataset depends on the published aqua-fetch release (pinned as aqua-fetch[all]>=1.1.0). If you encounter issues, reinstall with:
1 2 | |
Storage root not configured¶
Error: DatasetResolutionError: storage.local.root is not configured. Set it in ~/hydro_setting.yml
Solution: Ensure hydro_setting.yml exists in your home directory and contains a storage.local.root entry:
1 2 3 4 5 6 7 8 9 10 11 | |
A missing or empty file yields an empty config; path resolution then fails with the storage.local.root is not configured error above.
Upgrading¶
Upgrade to Latest Version¶
1 | |
Upgrade from an old hydro_setting.yml format¶
Older hydrodataset versions used a local_data_path block (and sometimes
datasets-origin / datasets-interim) in ~/hydro_setting.yml. Since the
ADR 0001 migration, the config uses a unified storage block, and the legacy
local_data_path keys are no longer read by the code.
Old format (no longer supported):
1 2 3 4 | |
New format:
1 2 3 4 5 | |
To migrate:
- Replace the
local_data_pathblock with thestorageblock above. local_data_path.rootmaps tostorage.local.root.- The
datasets-origin/datasets-interimkeys are not used any more and can be removed (both are covered bystorage.local.root). - Verify the migration:
1 2 3 4 | |
A storage.local.root is not configured error after upgrading means the old
local_data_path keys are still the only config present — convert them as above.
Upgrade from conda¶
1 | |
Uninstallation¶
1 2 3 4 5 | |
Next Steps¶
After installation:
1. ✅ Create hydro_setting.yml configuration file
2. 📖 Read the Usage Guide
3. 🚀 Try the Quick Start examples
4. 📚 Browse the API Documentation
If you encounter issues, check the FAQ or open an issue on GitHub.