HydroModPy#

A Python toolbox for automated, reproducible, catchment-scale modeling of shallow groundwater. One TOML configuration drives MODFLOW 6, MODFLOW-NWT, Boussinesq, and GR4J on the same hydrology, from DEM to calibrated heads and streams.

Important

This documentation tracks the v2 alpha line, currently 2.0.0a1. Install it with pip install --pre hydromodpy. Existing v1 projects should stay pinned to exact tags such as v1.0.0.

Install

pip install --pre hydromodpy or use the conda environment, then check the prerequisites.

Install
Get started

Concepts in five minutes, then a first end-to-end project on a real basin.

Getting Started
Configuration

Every TOML section validated by HydroModPyConfig, with fields, defaults, and types.

Configuration overview
API reference

Auto-generated reference for every public class, function, and module under hydromodpy.

API Reference

What HydroModPy does#

Physically based groundwater models remain expensive to deploy at the catchment scale: data wrangling, mesh design, parameterization, calibration, and post-processing rarely follow a uniform path from one site to the next. HydroModPy was built to close that gap. It turns the construction, execution, calibration, and analysis of unconfined shallow groundwater models into a single scriptable workflow that can be replayed across many catchments with consistent inputs and outputs.

The toolbox automates the steps that usually consume the most time:

  1. Watershed extraction from digital elevation models, with the geospatial backbone provided by WhiteboxTools and the standard geospatial Python stack.

  2. Forcing preparation: spatial and temporal recharge, climate inputs, and observation ingestion (groundwater heads, stream networks, intermittency patterns).

  3. Mesh and vertical discretization suited to shallow basement aquifers, plus parameter assignment and steady or transient runs.

  4. Calibration and validation that combine subsurface heads with surface signals (active stream networks, intermittency) to constrain hydraulic properties.

  5. Standard, FAIR-aligned exports with provenance metadata, plus built-in visualization and notebook integration for teaching and reproducible analyses.

Originally a FloPy-driven MODFLOW-NWT toolbox, HydroModPy now ships a multi-solver architecture, a Pydantic-validated configuration, and a columnar storage stack (DuckDB catalog, Zarr fields, Parquet tables) that make end-to-end runs reproducible and inspectable.

Highlights#

Multi-solver core

MODFLOW 6, MODFLOW-NWT, Boussinesq, and GR4J behind a single adapter layer. Optional MODPATH and MT3DMS for particle tracking and solute transport.

Solvers
TOML-first interface

One HydroModPyConfig root, every field typed and validated by Pydantic v2. The CLI hmp runs the same config without any Python.

Configuration overview
Catchment automation

DEM-driven watershed delineation, recharge forcing, mesh and vertical discretization, observation ingestion, all from one configuration.

User Guide
Calibration and validation

Heads, stream networks, and intermittency patterns combined into reproducible calibration loops with provenance tracking.

Calibration Workflow
FAIR-aligned outputs

DuckDB catalog, Zarr field arrays, Parquet tables, and standard geospatial formats with metadata for interoperability.

Results and Exports
Gallery and teaching

Validation figures, mesh illustrations, and notebook examples curated for documentation, training, and decision support.

Capability Gallery

What’s new#

Recent entries from CHANGELOG.md:

  • v0.3.3 (2025-12-03): lightweight conda environment option, surface routing consolidated under masstransfer, leaner SIM2 memory use.

  • v0.3.2 (2025-11-28): SIM2 reworked with coarse-clip then reproject, disk_clip accepts .shp, .gpkg, .geojson.

  • v0.3.1 (2025-11-14): installation guide reorganized, dual YAML options for runtime versus editable installs, NumPy >= 2 baseline.

See the full changelog and the roadmap for upcoming work.

How to cite#

If HydroModPy supports your work, please cite both the software and the companion technical note (Gauvain et al., 2026, EGUsphere, doi:10.5194/egusphere-2026-868). The How to cite HydroModPy page lists BibTeX, RIS, and plain-text variants; CITATION.cff at the repository root is what GitHub renders behind the “Cite this repository” button.

BibTeX entries
@software{hydromodpy_software,
  title   = {HydroModPy: a Python toolbox for deploying catchment-scale shallow groundwater models},
  author  = {Gauvain, A. and Abherv\'e, R. and Boivin, B. and Roques, C. and
             Le Mesnil, M. and Coche, A. and Babey, T. and Mar\c{c}ais, J. and
             Bouchez, C. and Leray, S. and Marti, E. and Bresciani, E. and
             Figueroa, R. and P\'elissier, M. and Guillaumot, L. and
             Touzeau, T. and Issolah, I. and Maugan, E. and Bagagnan, R. S. and
             Vautier, C. and Sallou, J. and Bourcier, J. and Combemale, B. and
             Brunner, P. and Longuevergne, L. and Aquilina, L. and
             de Dreuzy, J.-R.},
  year    = {2026},
  url     = {https://github.com/HydroModPy/HydroModPy},
  license = {EPL-2.0}
}

@article{egusphere-2026-868,
  title   = {Technical note: HydroModPy -- a Python toolbox for deploying catchment-scale shallow groundwater models},
  author  = {Gauvain, A. and Abherv\'e, R. and Boivin, B. and Roques, C. and
             Le Mesnil, M. and Coche, A. and Babey, T. and Mar\c{c}ais, J. and
             Bouchez, C. and Leray, S. and Marti, E. and Bresciani, E. and
             Figueroa, R. and P\'elissier, M. and Guillaumot, L. and
             Touzeau, T. and Issolah, I. and Maugan, E. and Bagagnan, R. S. and
             Vautier, C. and Sallou, J. and Bourcier, J. and Combemale, B. and
             Brunner, P. and Longuevergne, L. and Aquilina, L. and
             de Dreuzy, J.-R.},
  journal = {EGUsphere},
  year    = {2026},
  volume  = {2026},
  pages   = {1--31},
  doi     = {10.5194/egusphere-2026-868}
}

Linked publications and a registry of catchments where HydroModPy has been deployed live on Papers using HydroModPy and Geographic application map.

Documentation map#

Get started

Install HydroModPy, scaffold a workspace, and run a first end-to-end simulation in five steps.

Getting Started

User Guide

Usage modes, workflow families, cookbook, and the theory backing each solver.

User Guide

Configuration

Every TOML section validated by HydroModPyConfig: fields, defaults, types, plus the JSON Schema explorer.

Configuration overview

Gallery

Static mesh illustrations, validation figures, and watershed diagnostics curated for documentation and teaching.

Capability Gallery

API Reference

Auto-generated reference for every public class, function, and module under hydromodpy.

API Reference

Developer

Architecture, code-reading maps, component and class diagrams, developer notes, and contributing guidelines.

Architecture and Developer Guide

About

How to cite HydroModPy, papers using the toolbox, and field applications across catchments.

About

Authors and contact#

Authors and affiliations

A. Gauvain1,2, R. Abhervé1,3,4, B. Boivin1, C. Roques3, M. Le Mesnil1, A. Coche1, T. Babey1, J. Marçais5, C. Bouchez1, S. Leray6, E. Marti6, E. Bresciani7, R. Figueroa3, M. Pélissier3, L. Guillaumot8, T. Touzeau1, I. Issolah11, E. Maugan1, R. S. Bagagnan1, C. Vautier1, J. Sallou9, J. Bourcier10, B. Combemale11, P. Brunner3, L. Longuevergne1, L. Aquilina1, J.-R. de Dreuzy1.

  • 1 Geosciences Rennes - UMR 6118, CNRS, UniversitĂ© de Rennes, Rennes, France

  • 2 Laboratoire de MĂ©tĂ©orologie Dynamique (LMD), CNRS, Sorbonne UniversitĂ©, Paris, France

  • 3 Centre for Hydrogeology and Geothermics (CHYN), UniversitĂ© de Neuchâtel, Neuchâtel, Switzerland

  • 4 UMR SAS 1069, INRAE, Centre Bretagne-Normandie, Rennes, France

  • 5 UR RiverLy, INRAE, Centre Lyon-Grenoble Auvergne-RhĂ´ne-Alpes, Villeurbanne, France

  • 6 Pontificia Universidad CatĂłlica de Chile, Santiago, Chile

  • 7 Instituto de Ciencias de la IngenierĂ­a, Universidad de O’Higgins, Rancagua, Chile

  • 8 BRGM, F-45060 OrlĂ©ans, France

  • 9 INF, Wageningen University & Research, Wageningen, Netherlands

  • 10 ISA/LIUPPA, UniversitĂ© de Pau et des Pays de l’Adour, Pau, France

  • 11 Inria, IRISA, CNRS, UniversitĂ© de Rennes, Rennes, France

For questions or collaboration requests, contact:

  • Alexandre Gauvain, alexandre.gauvain.ag@gmail.com

  • Ronan AbhervĂ©, ronan.abherve@gmail.com

  • Bug reports and feature requests: GitHub issues

  • Discussions: Google Group