Skip to content

Releases: hyriver/py3dep

v0.18.0

06 Oct 03:36
Compare
Choose a tag to compare

Release Notes

Breaking Changes

  • Drop support for Python 3.8 since its end-of-life date is October 2024.
  • Remove all exceptions from the main module and raise them from the exceptions module. This is to declutter the public API and make it easier to maintain.

v0.17.1

14 Sep 16:42
Compare
Choose a tag to compare

Release Notes

Internal Changes

  • Drop support for Python 3.8 since its end-of-life date is October 2024.

v0.17.0

07 Jul 17:10
Compare
Choose a tag to compare

Release Notes

Internal Changes

  • Add the exceptions module to the high-level API to declutter the main module. In the future, all exceptions will be raised from this module and not from the main module. For now, the exceptions are raised from both modules for backward compatibility.
  • Switch to using the src layout instead of the flat layout for the package structure. This is to make the package more maintainable and to avoid any potential conflicts with other packages.
  • Add artifact attestations to the release workflow.

v0.16.3

25 Apr 02:51
Compare
Choose a tag to compare

Release Notes

Bug Fixes

  • In check_3dep_availability function, fix a bug where the function fails to return a valid response when the web service is down.

v0.16.2

12 Feb 15:35
Compare
Choose a tag to compare

Release Notes

Bug Fixes

  • In add_elvation function, fix a bug where the function fails to add elevation to a xarray.Dataset with x and y dims not being x and y.

Internal Changes

  • Refactor fill_depressions function by porting the code from pyflwdir and improve its performance and also now, it directly support xarray.DataArray. Now, pyflwdir is not an optional dependency anymore. You can install numba to improve the performance of the function.

Breaking Changes

  • The AirMap service has been deprecated and removed from the package. The elevation_bycoords function now only supports the the National Map and the 3DEP services.

v0.16.1

15 Jan 18:31
Compare
Choose a tag to compare

Release Notes

Bug Fixes

  • In the check_3dep_availability function when the web service is down the function raises a TypeError instead of setting the value of the failed resolution to Failed. This is fixed now. (66{.interpreted-text role="issue_3dep"}).

Internal Changes

  • Simplify the logic of adding elevation to a Dataset in the add_elevation function to avoid modifying CRS of the input Dataset.

v0.16.0

03 Jan 21:06
Compare
Choose a tag to compare

Release Notes

New Features

  • Add a new function called get_map_vrt for getting DEM within a bounding box and saving it as a VRT file. This function has low memory usage and is useful for cases where the DEM is needed for a large area. Moreover, even for usual use cases it can be much faster than get_dem since it loads the data lazily, at the cost of higher disk usage.
  • In the get_map function, check if the input geometry is within the bounds of the 3DEP's WMS service and if not, raise an exception.
  • In the fill_depressions function add a new argument called outlets for specifying outlet detection method: At the edge of all cells (edge) or only the minimum elevation edge cell (min; default).
  • Significantly improve the performance of check_3dep_availability function by minimizng the number of requests to the service and sending all requests asynchronously. Also, the returned dict now uses Failed for those resolutions where the service fails to return a valid response. It will remove the failed responses from the cache, so next time the function is called, it will try to get only the failed resolutions.
  • Add four new options to add_elevation: mask for passing a mask and resolution for specifying the resolution of the source DEM, and x_dim and y_dim for passing the names of spatial dimensions in the input dataset. The mask option is useful for cases where the input xarray.DataArray or xarray.Dataset has a mask and the user wants to use that mask for the elevation data as well. The resolution option is useful for cases where the user wants to get the elevation data at a higher resolution that will be downsampled by bilinear interpolation to the resolution of the input xarray.DataArray or xarray.Dataset. The default is resolution=None which means the resolution of the input xarray.DataArray or xarray.Dataset will be used. The x_dim and y_dim options are useful for cases where the input xarray.DataArray or xarray.Dataset has different names for spatial dimensions than x and y. The default is x_dim="x" and y_dim="y".

Breaking Changes

  • In the elevation_profile function remove the res argument and use 10-m resolution DEM from 3DEP. Also, add two new attributes to the output xarray.Dataset: source for the dataset to state the data source used and units for the distance variable to state the units of the distance, which is meters.

Internal Changes

  • Improve initial load time by moving import pyflwdir to the fill_depressions function.

Bug Fixes

  • Decrease the number of pixels per request from 10e6 to 8e6 to reduce the request load (65{.interpreted-text role="issue_3dep"}).

v0.15.2

22 Sep 14:25
Compare
Choose a tag to compare

Release Notes

Internal Changes

  • Remove dependency on dask.

v0.15.1

02 Sep 16:56
Compare
Choose a tag to compare

Release Notes

Bug Fixes

  • Fix HyRiver libraries requirements by specifying a range instead of exact version so conda-forge can resolve the dependencies.

v0.15.0

07 May 22:37
Compare
Choose a tag to compare

Release Notes

From release 0.15 onward, all minor versions of HyRiver packages will be pinned. This ensures that previous minor versions of HyRiver packages cannot be installed with later minor releases. For example, if you have py3dep==0.14.x installed, you cannot install pydaymet==0.15.x. This is to ensure that the API is consistent across all minor versions.

New Features

  • In static_3dep_dem use rioxarray directly instead of rasterio since it can handle VRT files.
  • Improve performance and accuracy of add_elevation by using the dynamic 3DEP service and setting the resolution based on the input xarray.DataArray or xarray.Dataset.
  • Improve the performance of elevation_profile by using the static 3DEP service when the input resolution is 10 m (which is the default for this function).
  • For now, retain compatibility with shapely<2 while supporting shapley>=2.

Bug Fixes

  • In add_elevation, ensure that the resolution is in meters by reprojecting the input dataset to 5070 before extracting resolution and bound attributes.