PyAges v1.0: an extensible Python toolkit for inferring groundwater transit-time distributions from environmental tracers
Abstract. Lumped-parameter models infer groundwater transit-time distributions by combining environmental-tracer input histories with parameterized age distributions. Their practical use requires flexible tracer representation, reliable repeated numerical integration, and explicit treatment of uncertainty when different parameter combinations fit observations similarly. We present PyAges v1.0, an open-source Python toolkit that separates tracer definitions, lumped-parameter models, convolution, and calibration; supports Bayesian inference of parameter uncertainty; and uses an integration scheme based on the cumulative distribution function and partial first moment for repeated evaluation of narrow, shifted, mixed, and shape-free transit- time distributions. Independent reference calculations across 270 cases characterize numerical discrepancies of the PyAges convolution operator across four classical model families. A cross-software benchmark against TracerLPM shows that both tools estimate the prescribed parameters with broadly comparable accuracy. Mean transit time is estimated more robustly under added noise than the model- specific parameter controlling either exponential–piston mixing or dispersion. Two field sites, Holten and Ploemeur, illustrate the framework with real observations. At Holten, PyAges posterior medians reproduce all 28 published four-bin age fractions within 0.02. At Ploemeur, calibrations using the full record or only 2014–2015 observations show how repeated measurements can resolve age ambiguity or reveal incompatibility among the assumptions used to interpret the tracers. PyAges therefore provides a reproducible framework for testing tracer and transit-time hypotheses, determining what observations constrain, and integrating tracer inference into broader hydrogeological workflows.
The manuscript presents PyAges, an open-source Python toolkit for inferring groundwater transit-time distributions from environmental tracers. The development of a flexible and reproducible computational framework is valuable. However, several issues regarding the novelty of the toolkit, uncertainty characterization, and comparison with existing tools require further clarification. I recommend major revision. My specific comments are provided below.
Major Comments
1. The Introduction should more clearly identify the limitations of existing tools and the specific challenges addressed by PyAges. In particular, what are the theoretical or computational advantages of PyAges over existing packages such as TracerLPM? The authors should better distinguish the contributions of the proposed toolkit from those of previous implementations.
2. The toolkit employs the conventional Metropolis-Hastings (M-H) algorithm, which may suffer from low sampling efficiency. Have the authors considered more advanced algorithms, such as DRAM or DREAM, to improve computational efficiency and posterior exploration? Relevant references include DOI: 10.1029/2019WR025474 and https://github.com/jaspervrugt/DREAM-Suite.
3. Table 3 indicates that PyAges and TracerLPM exhibit different advantages under different experimental conditions. The authors should further explain the reasons for these differences, particularly why one toolkit achieves better parameter recovery in certain cases but performs worse in others. The influence of the optimization methods and objective functions should also be discussed.
4. The manuscript repeatedly discusses non-uniqueness, commonly referred to as equifinality in hydrology. However, the posterior characteristics associated with this phenomenon are not sufficiently explored. Equifinality may manifest as strong parameter correlations, broad posterior regions, or multimodal distributions. I suggest presenting additional figures demonstrating marginal and bivariate posterior distributions to better illustrate parameter equifinality and potential multimodality. See DOI: 10.1002/2017WR020906.
5. Sections 4.1 and 4.2. I suggest including results from established tools, such as TracerLPM, in the Holten and Ploemeur applications. Such comparisons would provide stronger evidence of the practical advantages and reliability of PyAges.
6. Figure 4. The authors assume a constant relative observation uncertainty of 20%. However, this assumption produces substantially larger absolute uncertainties for higher observed concentrations, as illustrated in Figure 4e. The authors should further justify this error model and discuss whether it adequately represents actual measurement and sampling uncertainties.
7. The authors primarily report posterior medians rather than means. Please explain the rationale for this choice and whether it is related to the skewness or other characteristics of the posterior distributions.
Minor Comments
1. L23: The expression “within 0.02” is ambiguous. Please clarify what this value represents and whether it is dimensionless.
2. L59: “mesas.py” appears to be a Python filename rather than a formal software name. Please use the official name of the algorithm or software package.
3. L62, L109-110, and L175: Please define TTD, CFCs, SF₆, pptv, and YAML at their first occurrence.
4. L65: Please avoid using DREAM without defining the acronym. Alternatively, use the more general term MCMC where appropriate.
5. L137: Would RMSE, or more precisely a normalized RMSE, be a more appropriate designation for the reported metric?
6. L153: Please consider citing the original Gelman-Rubin convergence-diagnostic literature in addition to the more recent references.
7. Section 2.2: Although Figure 1 provides an overview of the toolkit, a more detailed diagram illustrating the functions and interactions of the individual modules would improve clarity.
8. Section 2.2.4: The CDF-partial-first-moment integration scheme is part of the theoretical and numerical formulation. I suggest moving its description closer to Equation (1).
9. L258-259: Please specify which deterministic optimization algorithms are implemented in PyAges.
10.L321: Please change “8 %” to “8%” for consistency with the suggested percentage formatting.
11. L352: The mathematical formatting of the square-root expression should be improved.
12. L360: Consider using “the Holten case” and “the Ploemeur case” for clearer references to the field applications.
13. L377-378: The description of the unsaturated-zone transit time is unclear. Please clarify the physical meaning of the assumed two-year delay and explicitly define the variable “a”.