Skip to content

Releases: hydrobricks/hydrobricks

v0.8.7

10 May 16:00
43a5c6b

Choose a tag to compare

Breaking changes

  • The functions model.is_ok() and parameters.is_ok() have been renamed to model.is_valid() and parameters.are_valid() or parameters.is_valid() respectively.

Added

  • Add custom exception classes (C++ and Python).
  • Add additional IsValid() functions (C++).
  • Add BrickCategory enum (C++).
  • Add Has* methods to various classes for better state checking (C++).
  • Add TryGet methods to HydroUnit (C++).

Fixed

  • Handle decreasing coordinate axes in TimeSeries2D spatial selection.

Changed

  • Various C++ and Python code refactoring.
  • Rename count variables (e.g. GetChangesNb() becomes GetChangesCount() in C++ and get_hydro_unit_nb() becomes get_hydro_unit_count() in Python).
  • Externalize results writing from the Logger to a dedicated Results class (C++).
  • Provide more information when enums fail to parse (C++).
  • Refactor C++ exceptions.
  • Improve pointers ownership (C++).
  • Refactor Parameters in the C++ core.
  • Rename IsOk() to IsValid() in the C++ core.
  • Update logging to use the logging module instead of print statements (Python).
  • Refactor the Observations class (Python).
  • Refactor the trainer class (Python).
  • Remove wxWidgets dependency in favor of C++ standard library features.
  • Simplify area computation in compute_area (Python).
  • Improve raster file I/O resource management (Python).
  • Centralize object creation with registry pattern (C++).
  • Adopt C++23 standard library features (C++).
  • Enhance error handling with std::expected (C++).
  • Decouple model construction from ModelHydro class (C++).

v0.8.6

18 Dec 23:18
4728890

Choose a tag to compare

Added

  • Adding computation of ice thickness changes (observation-based delta-h).
  • Adding a check that the action has been initialized.
  • Checking that the model is initialized before adding actions.
  • Adding helpers to the Results class.

Changed

  • Refactoring the parameters definition (no impact for the users).
  • Moving examples to the root folder.
  • Converting stringly-typed identifiers to enums (no impact for the users).

v0.8.5

28 Aug 08:33
7b90820

Choose a tag to compare

Added

  • Prevents lateral snow slide from causing unrealistic snow accumulation in target areas by limiting redistribution when the target snowpack already exceeds a threshold.

v0.8.4

28 Aug 00:22
e966e67

Choose a tag to compare

Added

  • Adding a snow to ice transformation process for glaciers following the SWAT model approach (Luo et al., 2013).
  • Adding a snow to ice transformation action that transforms all snow to ice at a given date (e.g., end of the melt season).

Fixed

  • Fixing an issue when glacier volume is increasing further than the initial volume in the glacier evolution methods.

Changed

  • In the connectivity calculation, the 'force_connectivity' option was changed to False by default due to potential issues in some cases (e.g., exchange back and forth).

v0.8.3

14 Aug 14:41
487c9ad

Choose a tag to compare

Fixed

  • Fixing an issue with the gradient-based interpolation for temperature and precipitation when spatializing from gridded data.

v0.8.2

12 Aug 13:03
ef89e91

Choose a tag to compare

Breaking changes

  • The extraction of meteorological data from netCDF files (spatialize_from_gridded_data) has changed. The function now computes elevation gradients by default for temperature and precipitation. In order to access to the DEM, the class must be initialized with the catchment object (forcing = hb.Forcing(catchment)) instead of the hydro units object. This gradient-based interpolation can be disabled with apply_data_gradient=False.

Added

  • Adding a gradient-based interpolation for temperature and precipitation when spatializing from gridded data.
  • Making the SnowSlide parameters accessible.
  • Adding a parameter to the SnowSlide method to control the overall maximum snow depth.

Fixed

  • The actions were not correctly re-initialized when resetting the model. This is now fixed.
  • Improving land cover fraction checks in actions.
  • Fixing issue related to hydro unit ids when loading from csv file. The hydro units were not retrieved from the file, but assumed increasing, which is wrong when sorted by elevation.
  • Fixing hydro unit ids in land cover extraction.
  • Fixing index issues related to Pandas iterrows() usage.

Changed

  • Avoid snow redistribution to too small areas.
  • Capping the snow redistribution rate to 1000 mm of SWE.

v0.8.1

06 Aug 14:08
0c7bc90

Choose a tag to compare

Fixed

  • Adding trainer support for failing simulations.
  • Fixing precision issue in land cover fraction check.
  • Allow for floating-point imprecision in initial glacier extent.

v0.8.0

16 Jul 19:33
3f5eb58

Choose a tag to compare

Breaking changes

  • The minimum Python version is now 3.10.
  • Behaviours were renamed as Actions.
  • Changing logging labels for content to type-specific labels ("content" becomes "water_content", "ice" becomes "ice_content", "snow" becomes "snow_content").

Added

  • Adding the delta-h glacier evolution method (Huss et al., 2010) following Seibert et al. (2018) implementation of a look-up table.
  • Adding a simple glacier evolution method based on the glacier area and volume changes.
  • Adding lateral connections to hydro units in the C++ core.
  • Adding the SnowSlide method (Bernhardt & Schulz, 2010) for snow redistribution.
  • Adding a snow to ice transformation process (constant rate).
  • Adding an option to force the connectivity to neighbors when there is no downstream unit.
  • Adding setting an initial state to bricks.
  • Allow for sporadic and recursive actions (e.g. glacier area update).
  • Adding an option to load the hydro units from the catchment object.

Fixed

  • Fixing an issue with the dlls when installing the module in editable mode.
  • Completing documentation of the C++ code.
  • Adding type hints to Python function arguments.
  • Improving Python code readability.

Changed

  • Updating some example scripts.
  • Refactoring the catchment class to extract specific functionalities (no impact for the users).
  • Changing raster extraction for a more flexible approach.
  • Removing lateral connectivity with weight under 1%.
  • Rounding the lateral connectivity weight values.
  • Sorting hydro units by elevation to ensure a consistent order for snow redistribution.
  • Changing convention for member variables naming in C++.
  • Namespacing the global variables.

v0.7.6

23 Jan 20:48
d2996fb

Choose a tag to compare

Added

  • A new function to compute the connectivity between hydrological units has been added.
  • New reference metrics have been added (bootstrapping approach).

Fixed

  • Fixing issues related to updated dependencies (dask, pyarrow, pysheds).
  • Fixing CI issues.

v0.7.5

31 Oct 13:55
e275a6b

Choose a tag to compare

Breaking changes

  • The 'isohypse' option has been renamed to 'equal_intervals' in the catchment discretization functions.

Added

  • Adding the option to discretize the catchment by slope intervals.

Changed

  • Using vcpkg for the C++ dependencies instead of conan. This allows building the package for Python >= 3.12.
  • The basic requirements are automatically installed when installing the package from PyPI.