HydroModels.jl
Overview
HydroModels.jl is a modern hydrological modeling framework that extends and enhances SUPERFLEX's design philosophy. Built on Julia language and the SciML (Scientific Machine Learning) ecosystem, it combines flexible model construction with computational efficiency, particularly supporting deep learning integration in hydrological modeling.
Key Features
- 🎯 Type-Stable Configuration: New
HydroConfigsystem for optimal compiler optimization - 🚀 Fully Zygote Compatible: Immutable solver for seamless automatic differentiation
- 🔧 Flexible Model Construction: Supports lumped, semi-distributed, and distributed models
- 💡 Dual Construction Approaches: Both symbolic (@macros) and functional (pure functions) interfaces
- 🧠 Deep Learning Integration: Neural network components for hybrid modeling
- ⚡ High Performance: Leverages Julia v1.12+ advanced features
- 📊 Efficient Solvers: Multiple solver types (Mutable, Immutable, ODE, Discrete)
Framework Capabilities
HydroModels.jl offers:
- Easy implementation and customization of hydrological models
- Integration with Julia's scientific computing ecosystem
- Support for various modeling approaches:
- Traditional conceptual models
- Neural network enhanced models
- Distributed hydrological systems
Installation
using Pkg
Pkg.add("HydroModels")Quick Start
Get started quickly with our updated examples:
using HydroModels
# Define model using macros
@variables temp prcp flow
@parameters k
flux = @hydroflux flow ~ k * prcp
bucket = @hydrobucket :simple begin
fluxes = begin
flux
end
end
# Configure and run
config = HydroConfig(solver = MutableSolver)
output = bucket(input_data, params, config)See the Getting Started Guide for a complete tutorial.
New in Version 0.6.3
- ✅ Clearer Interpolation Names:
ConstantInterpolationandLinearInterpolationreplace confusing old names - ✅ Type-Stable Configuration System: New
HydroConfigreplaces NamedTuple - ✅ Simplified Solver Types:
MutableSolver,ImmutableSolver,ODESolver,DiscreteSolver - ✅ Enhanced Performance: 5-10% speed improvement, better memory efficiency
- ✅ Improved Zygote Support: Score improved from 8.5/10 to 9.5/10
- ✅ Functional Construction: Build fluxes with pure Julia functions
- ✅ Better Error Messages: Clear validation and helpful error reporting
- ✅ Consistent Terminology:
htypesfor multi-node modeling - ✅ Extension-First Neural Integration: Lux-backed neural constructors and initialization are provided by
HydroModelsLuxExt
See Migration Guide for upgrading from v0.5.x.
Important Notes
- If you find any issues, please post them in the issues section
- Check out our executable examples in the notebook folder
- For migration from v0.5.x, see Migration Guide
Contributing
HydroModels.jl is an open-source project available on Github. We welcome contributions from the community to help advance deep learning applications in hydrology.