Skip to content

Releases: hyriver/py3dep

v0.13.3

25 Jun 23:24

Choose a tag to compare

Release Notes

Bug Fixes

  • Fix a bug in check_3dep_availability where due to changes in pygeoogc ZeroMatched exception is raised instead of TypeError and as a result check_3dep_availability was not working as expected.

v0.13.2

14 Jun 05:31

Choose a tag to compare

Release Notes

Breaking Changes

  • Set the minimum supported version of Python to 3.8 since many of the dependencies such as xarray, pandas, rioxarray have dropped support for Python 3.7.

Internal Changes

  • Use micromamba for running tests and use nox for linting in CI.

v0.13.1

12 Jun 04:49

Choose a tag to compare

Release Notes

New Features

  • In deg2mpm function look for _FillValue and nodatavals in the attributes and if not found, fall back to numpy.nan.

Internal Changes

  • Ensure that the deg2mpm function uses dask if the input is dask-enabled.
  • In the elevation_profile function use a bounding box to get DEM and a linear interpolation to get the elevation along the profile.

v0.13.0

03 Apr 22:19

Choose a tag to compare

Release Notes

New Features

  • Add a new function called query_3dep_sources for querying bounds of 3DEP's data sources within a bounding box. It returns a geo-dataframe that contains the bounding box of each data source and a column dem_res identifying the resolution of the raw topographic data within each geometry.
  • Add a new function called elevation_profile for getting elevation profile along a line at a given spacing. This function converts the line to a B-spline and then calculates the elevation along the spline at a given uniform spacing.

Breaking Changes

  • Remove caching-related arguments from all functions since now they can be set globally via three environmental variables:

    • HYRIVER_CACHE_NAME: Path to the caching SQLite database.
    • HYRIVER_CACHE_EXPIRE: Expiration time for cached requests in seconds.
    • HYRIVER_CACHE_DISABLE: Disable reading/writing from/to the cache file.

    You can do this like so:

import os

os.environ["HYRIVER_CACHE_NAME"] = "path/to/file.sqlite"
os.environ["HYRIVER_CACHE_EXPIRE"] = "3600"
os.environ["HYRIVER_CACHE_DISABLE"] = "true"

v0.12.2

15 Jan 17:56

Choose a tag to compare

Release Notes

New Features

  • Add a new DEM source to elevation_bycoords to get elevation from the National Map's 3DEP WMS service. This can replace the tnm source since tnm is not stable.
  • Add a new function called check_3dep_availability to check the availability of 3DEP's native resolutions within an area of interest. It returns a dict with keys corresponding to the available resolutions and its values are boolean values indicating whether the resolution is available or not.
  • Replace no data values of slope in deg2mm with np.nan, so they do not get converted to another values. The output of this function has np.float64 type.

Internal Changes

  • Refactor ElevationByCoords by using __post_init__ for validating the input parameters rather than pydantic's validators.
  • Refactor elevation_bygrid by using get_map to get DEM and rioxarray for re-projection.
  • Add type checking with typeguard and fixed typing issues raised by typeguard.
  • Refactor show_versions to ensure getting correct versions of all dependencies.

v0.12.1

31 Dec 07:47

Choose a tag to compare

Release Notes

Internal Changes

  • Use the three new ar.retrieve_* functions instead of the old ar.retrieve function to improve type hinting and to make the API more consistent.

v0.12.0

28 Dec 03:10

Choose a tag to compare

Release Notes

Breaking Changes

  • Set the request caching's expiration time to never expire. Add two flags to all functions to control the caching: expire_after and disable_caching.

Internal Changes

  • Add all the missing types so mypy --strict passes.
  • Improve performance of elevation_bygrid by ignoring unnecessary validation.

v0.11.4

12 Nov 22:02

Choose a tag to compare

Release Notes

Internal Changes

  • Use rioxarray for dealing with GeoTIFF binaries since xarray deprecated the xarray.open_rasterio function, as it's discussed in this PR.
  • Use importlib-metadata for getting the version insead of pkg_resources to decrease import time as discussed in this issue.

v0.11.3

04 Oct 03:53

Choose a tag to compare

Release Notes

Breaking Changes

  • Rewrite the command-line interface using click.group to improve UX. The command is now py3dep [command] [args] [options]. The two supported commands are coords for getting elevations of a dataframe of coordinates in EPSG:4326 CRS and geometry for getting the elevation of a geo-dataframe of geometries. Each sub-command now has a separate help message. The format of the input file for the coords command is now csv and for the geometry command is .shp or .gpkg and must have a crs attribute. Also, the geometry command now accepts multiple layers via the --layers (-l) option. More information and examples can be in the README.rst file.

New Features

Internal Changes

  • The get_map function now checks for validation of the input layers argument before sending the actual request with a more helpful message.
  • Improve docstrings.
  • Move deg2mpm, fill_depressions, and reproject_gtiff functions to a new file called utils. Both deg2mpm and fill_depressions functions are still accessible from py3dep directly.
  • Increase the test coverage.

v0.11.2

17 Sep 06:35

Choose a tag to compare

Release Notes

Bug Fixes

  • Fix a bug related to elevation_bycoords where crs validation fails if its type is pyrpoj.CRS by converting inputs with CRS types to string.

Internal Changes

  • Fix a couple of typing issues and update the get_transform API based on the recent changes in pygeoutils v0.11.5.