Releases: hydpy-dev/hydpy
HydPy 6.1.1
The function create_projectstructure introduced in HydPy 6.1.0 was only of limited use because one still had to manually create the project's subdirectories (for example, projectroot/network/default
). With HydPy 6.1.1, the different FileManager subclasses do this automatically if their base directory (for example, projectroot/network
) is still empty. See (the end) of the documentation on the currentdir property for an example.
HydPy 6.1.0
With HydPy 6.1, we switch to a tighter release cycle. Compared to HydPy 6.0, there are a few breaking changes, but those require, at most, little client code adjustments (ask you type checker) and do not change any functionality. Hence, the transition from 6.0 to 6.1 should be smooth.
Here is the list of the most notable new features, documentation improvements, and fixes.
New features:
- The different file managers (for example, the ConditionManager) now print a note when they create or remove a directory. This feature can be turned off by setting printprogress to
False
. - The new "script function" xml_validate allows to check if an XML workflow file fits to XSD schema definition file of the relevant HydPy version from the command line.
- Reading time series from or writing time series to NetCDF files via the related methods of the classes HydPy, Elements, and Nodes now works "automatically", meaning one has not to bother with manually opening and closing NetCDF reader and writer objects anymore.
- The option reprdigits now controls the number format for writing ASCII time series files. By default, all numbers are written in scientific notation (consistent with HydPy 6.0). If you set reprdigits to two, for example, all numbers are written in the decimal form with at most two decimal places
- Class ConditionManager now has the option prefix for changing the prefix of the automatically determined, time-dependent condition directory names. This feature eases, for example, to read the initial conditions of different ensemble members from separate directories
- All subelements of
<conditions_io>
in XML workflow files are now optional. Making the XML elements<inputpath>
and<outputpath>
optional was necessary because otherwise, the new element<prefix>
would be generally impactless. Making the XML element<zip>
optional was primarily for consistency but also for convenience, as its default valuefalse
should apply to most use cases. - When using HydPy from the command line, you can now select two alternative error styles (
single_line
andsplittable
) to squeeze printed error messages in single lines, which is more easily processable for tools like Delft-FEWS. The old behaviour is now namedmultiline
and the default of the newerrorstyle
option. For more information, please look at the documentation for the central hyd.py script. - Function summarise_ncfile now automatically determines and prints the time grid of the analysed NetCDF file if it has the
time reference
attribute defined. - The new functions create_projectstructure and check_projectstructure create and check the basic directory structure of a HydPy project. By default, checking also happens automatically when initialising class HydPy. This feature can be turned off by setting checkprojectstructure to
False
.
Documentation improvements:
- We added the Simulation section to the User Guide. It explains semi-comprehensively performing a simulation run via Python scripts or XML workflow files. It should build a bridge between the Quick Start's introductory remarks and the Reference Manual's extremely detailed explanations.
- The new Creating an Environment section of the Installation Instructions introduces to using virtual environments for the robust installation of, for example, different HydPy versions on the same computer.
Fixes:
- Reading initial conditions files with initial condition data already in RAM (for example, resulting from a previous simulation run) could result in unnecessary trimmings of the read values. The user was warned but had to solve the problem himself (for example, by deleting the data first and rereading the files afterwards). We fixed this issue by applying the "postponed trimming" strategy already implemented for resetting data via dictionaries.
HydPy 6.0.1
HydPy 6.0.0
We are happy to announce the release of HydPy 6.0, which comes with many documentation improvements, lots of new models, and, most importantly, a boost in flexibility in combining different model components.
Documentation improvements
We gave the documentation a new structure. Beginners will find it convenient that it now differentiates between a User Guide, which offers a basic introduction to HydPy, and a Reference Manual, which explains everything in depth. We included introductory tutorials (and plan to add tutorials that cover more complex use cases soon) based on the reworked HydPy-H-Lahn example project.
Submodel concept
Previously, one could easily combine models of different "families" in one project (for example, of HydPy-H(BV) and HydPy-L(ARSIM). However, no out-of-the-box mechanism existed for creating new combinations of different model components. Therefore, HydPy 6.0 introduces the Submodel concept. It allows, for example, to set up an HBV-like model that calculates evaporation similar to LARSIM.
So far, the new Submodel concept has been widely rolled out for meteorological factors like global radiation and evapotranspiration, and it at least partly covers topics like runoff concentration and flow formulas. We will modularise more model components in future HydPy versions. See the Submodel Graph in the new Model overview section for a complete list of the currently possible (and advisable) model compositions.
New models
At first sight, HydPy 6.0 comes with a multitude of new models. However, many are just new submodels that we extracted from already existing main models (the new Definitions section explains these terms in detail). For example, HydPy-Evap-PET-HBV96 stems from HydPy-H-HBV96.
Nevertheless, there are still some truly new models worth mentioning:
- HydPy-Evap-PET-AMBAV-1.0 calculates potential evapotranspiration in agreement with the AMBAV 1.0 model of the Deutscher Wetterdienst.
- HydPy-Dam contains three new models for modelling pumps and sluices.
- The new model family HydPy-GA is supposed to provide Green-Ampt infiltration models. The first available models implement the GARTO method, which can be used both as a main model to simulate infiltration excess overland flow for complex rainfall events independently and as a submodel to refine the volume-based runoff generation approach of HydPy-L(ARSIM).
- The new model family HydPy-SW1D introduces "hydrodynamic flood routing" to HydPy. It aims to robustly solve the 1-dimensional shallow water equations in river and channel networks. So, HydPy can now deal much better with catchments in lowland regions where hydraulic structures like weirs and sluices or tidal effects play a major role.
Model name changes
HydPy's model names were too cryptic, so we switched to more descriptive ones. For example, hland_v1 or HydPy-H-Land Version 1 is from now on hland_96 or HydPy-H-HBV96 (adoption of SMHI-IHMS-HBV96). You can find a complete list of all renamings here.
HydPy 6.0a0
This is the first pre-release of HydPy 6.0. Almost all of its new features have been implemented. Please look at issue #122 for the things still to come, which are mainly documentation-related.
We now support NumPy 1 and 2 (see issue #147). We included both in our test suites, but the now consistent usage of 64-bit integers (and floats) on all systems and all NumPy versions might cause unexpected inconveniences. Please open an issue if you encounter any problems.
HydPy 5.0.3
This release includes minor adjustments to make HydPy 5.0 compatible with older versions of NumPy (tested against NumPy 1.22).
HydPy 5.0.2
This release contains minor technical improvements compared to 5.0.1 and, more importantly, some adjustments to recent site-package changes (e.g. of NumPy). Its wheels are also available for Python 3.11, the latest Python version.
HydPy 5.0.1
Fix passing an application model's module to the constructor of class Rule of module calibtools. 62d6d9b
HydPy 5.0.0
We are pleased to announce the release of HydPy 5.0. It includes technical improvements, freshly implemented hydrological models and extended data-assimilation support. Also, it marks the first step of our efforts towards a higher degree of model modularity, with which we strive to increase the compatibility of the process abstractions of different model families. In the following, we highlight the most notable changes.
First of all, one "feature" that does not relate to HydPy 5.0 directly but to a policy established during its development: We try to shift at least the most relevant content-related discussions between the core members to the GitHub issue system. Sometimes we discuss online; other times, we only document discussion results. This policy helps us to keep track of different ideas and how things evolved, and - as important - it allows others to trace the development of HydPy better and to participate.
New models and model improvements:
- The new model H-Land (HBV96-SC) is a slight modification of the long-available H-Land (HBV96) model. Like H-Land (HBV96), H-Land (HBV96-SC) works largely like the conceptional HBV96 model but represents runoff concentration with a linear storage cascade instead of a triangular-shaped Unit-Hydrograph. We implemented the storage cascade as an array of states, allowing us to address it in state-based data assimilation efforts.
- H-Land (HBV96-SC/PREVAH) combines concepts from HBV96 and PREVAH, which is also a successor of the original HBV model. All processes "above the soil" (input data correction, interception, snowmelt) and "inside the soil" (evaporation, generation of effective precipitation), as well as the handling of water areas, are identical with H-Land (HBV96) (and so with HBV96). Most processes "below the soil" agree with PREVAH (runoff generation and concentration). We intended to implement H-Land (HBV96-SC/PREVAH) to improve the drought and small summer-event simulation of H-Land (HBV96) with process equations suitable for state-based data assimilation methods. We are pretty happy with its performance so that it will soon replace the current low-flow forecasting model for the river Rhine of the German Federal Institute of Hydrology. #67
- H-Land (HBV96-SC/COSERO) combines concepts from HBV96 and COSERO, which is another successor of the original HBV model. We developed it for the same reason and similar to H-Land (HBV96-SC/PREVAH), except that most processes "below the soil" agree with COSERO. In our first very preliminary studies in a few Rhine sub-catchments, its results were a little less convincing than those of H-Land (HBV96-SC/PREVAH), but we still need to examine it in more detail. #68
- All members of the HydPy-H-Land model family now include the new land cover type SEALED, allowing for simulating surface runoff from sealed surfaces. #71
- We improved the snow module of all HydPy-H-Land with the alpine regions of the river Rhine in mind. The changes include (1) a seasonally varying day-degree factor for considering the effect of the annual cycle of global radiation on snow melt, (2) the further subdivision of hydrological response units into snow classes for modelling the effects of small-scale snow-depth variability, and (3) the redistribution of snow due to gravitational and wind forcing. #70
- We introduced the HydPy-Musk model family, providing Muskingum-like methods, which are finite difference solutions to the routing problem. Its member Musk (classic) replaces HydPy-H-Stream Version 1. It implements the "classic" Muskingum approach (relying on the storage coefficient k and the weighting coefficient x). Alternatively, it supports defining the working equation coefficients via the parameters lag and damp like HydPy-H-Stream Version 1 did in the style of the IHMS implementation of HBV96. Ambitious users can also calculate the coefficients themselves. The second available member is Musk (MCT), which implements a form of the Muskingum-Cunge routing method developed by Todini. Currently, it is hard-coupled to the Manning-Strickler formula, applied on a trapezoidal channel profile. #85
- Until HydPy 4.0, our HydPy-Dam models did neither consider precipitation nor evaporation explicitly. Instead, the surrounding "land models" had to calculate these properties (because of our early efforts to strive for consistency with LARSIM). Now, all HydPy-Dam members take measured or calculated time series of precipitation and potential evaporation into account (for consistency with the old behaviour, one must currently supply time series with zero values). #51 #69
- We added the HydPy-Exch model family, which opens new paths for coupling different model instances in one project. Its first member Exch (weir) allows for a gradient-based, bidirectional coupling of the inputs/outputs of other model instances and is inspired by the IHMS implementation of HBV96. So far, we have used it in combination with Dam (controlled lake) to model, for example, the connectivity of the Swiss lakes Morat, Neuchatel, and Bienne via relatively short canals, through which water can flow in both directions depending on the actual water level differences of the respective lakes. #69
- The new model family HydPy-Meteo targets more fine-grained modularisation regarding meteorological "preprocessing". Meteo (global radiation, FAO) and Meteo (global radiation, LARSIM) calculate global radiation based on (possibly measured) sunshine duration and rely on the equations documented for the FAO grass reference evaporation method and the LARSIM model, respectively. Meteo (sunshine duration, FAO) and Meteo (sunshine duration, LARSIM) handle the inverse case and calculate sunshine duration based on global radiation (possibly stemming from meteorological simulations). This refactorisation allows, for example, to calculate potential grass evaporation with Evap (FAO) using LARSIM-like global radiation estimates or to calculate actual Penman-Monteith evaporation with HydPy-L-Land (Penman-Monteith, Knauf) using FAO-like global radiation estimates. #81
- We added more methods for checking that our model implementations satisfy the water balance equation, especially for our HBV- and LARSIM-like models. All checks are part of the automatic test system, and we fully report their results in the online documentation.
- We standardised the units of many variables. So, for example, we now generally use
$hPa$ for pressure terms and$W/m²$ for energy fluxes. This change might introduce some deviations from the original model descriptions in the literature but helps to avoid mistakes when setting up projects including different types of models. #81 - The new variable type FactorSequence allows for a better grouping of a model's different time series-related variables. We use it, for example, to separate state-like meteorological factors like air temperature from more flux-like variables like precipitation.
General and technical aspects:
- We dropped support for Python 3.6 (which reached its end of life) and started supporting Python 3.10 (the most recent Python release) instead.
- The processes for building (based on setuptools, not distutils) and testing (based on nox) are now up-to-date. One benefit for users is that creating HydPy wheels for alternative platforms becomes easy. #74
- HydPy 5.0 is compatible with the HydPy-OpenDA adapter 1.0 and includes numerous changes to satisfy its new functionalities. Please see the adapter's documentation and release notes for further information.
- Using NetCDF files now comes with a cleaner interface (mainly by removing of a few options that proved more irritating than helpful). Also, it now works both for left and right timestamps (meaning, the time points specified in a NetCDF file can relate to the start or the end of the respective time interval). #59 #84
- Reading and writing data "just in time", which helps save RAM in massive projects, now relies on the NetCDF format and is much more efficient...
HydPy 4.0.1 (supplemental data)
In HydPy 4.0.0, one needs to trigger the automatical generation of the sequence alias modules inputs.py
and outputs.py
by hand.
Since HydPy 4.0.1, they are already included in our binary distributions.