Skip to content

Releases: hyriver/pygeohydro

v0.13.6

30 Aug 17:30
Compare
Choose a tag to compare

Release Notes

Internal Changes

  • Add the missing PyPi classifiers for the supported Python versions.

v0.13.5

29 Aug 21:40
Compare
Choose a tag to compare

Release Notes

Breaking Changes

  • Append "Error" to all exception classes for conforming to PEP-8 naming conventions.
  • Deprecate ssebopeta_byloc since it's been replaced with ssebopeta_bycoords since version 0.13.0.

Internal Changes

  • Bump the minimum versions of pygeoogc and pygeoutils to 0.13.5 and that of async-retriever to 0.3.5.

v0.13.3

31 Jul 15:28
Compare
Choose a tag to compare

Release Notes

New Features

  • Add a new argument to NID.inventory_byid class for staging the entire NID dataset prior to inventory queries. There a new public method called NID.stage_nid_inventory that can be used to download the entire NID dataset and save it as a feather file. This is useful inventory queries with large number of IDs and is much more efficient than querying the NID web service.

Bug Fixes

  • The background value in cover_statistics function should have been 127 not 0. Also, dropped the background value from the return statistics.

v0.13.2

14 Jun 05:33
Compare
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

  • Remove USGS prefixes from the input station IDs in NWIS.get_streamflow function. Also, check if the remaining parts of the IDs are all digits and throw an exception if otherwise. Additionally, make sure that IDs have at least 8 chars by adding leading zeros (:issue_hydro:[99]{.title-ref}).
  • Use micromamba for running tests and use nox for linting in CI.

v0.13.1

12 Jun 04:53
Compare
Choose a tag to compare

Release Notes

New Features

  • Add a new function called get_us_states to the helpers module for obtaining a GeoDataFrame of the US states. It has an optional argument for returning the contiguous states, continental states, commonwealths states, or US territories. The data are retrieved from the Census' Tiger 2021 database.
  • In the NID class keep the valid_fields property as a pandas.Series instead of a list, so it can be searched easier via its str accessor.

Internal Changes

  • Refactor the plot.signatures function to use proplot instead of matplotlib.
  • Improve performance of NWIS.get_streamflow by not validating the layer name when instantiating the WaterData class. Also, make the function more robust by checking if streamflow data is available for each station and throw a warning if not.

Bug Fixes

  • Fix an issue in NWIS.get_streamflow where -9999 values were not being filtered out. According to NWIS, these values are reserved for ice-affected data. This fix sets these values to numpy.nan.

v0.13.0

04 Apr 06:36
Compare
Choose a tag to compare

Release Notes

New Features

  • Add a new flag to nlcd_* functions called ssl for disabling SSL verification.
  • Add a new function called get_camels for getting the CAMELS dataset. The function returns a geopandas.GeoDataFrame that includes basin-level attributes for all 671 stations in the dataset and a xarray.Dataset that contains streamflow data for all 671 stations and their basin-level attributes.
  • Add a new function named overland_roughness for getting the overland roughness values from land cover data.
  • Add a new class called WBD for getting watershed boundary (HUC) data.
from pygeohydro import WBD

wbd = WBD("huc4")
hudson = wbd.byids("huc4", ["0202", "0203"])

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"

Internal Changes

  • Write nodata attribute using rioxarray in nlcd_bygeom since the clipping operation of rioxarray uses this value as the fill value.

v0.12.4

04 Feb 22:25
Compare
Choose a tag to compare

Release Notes

Internal Changes

  • Return a named tuple instead of a dict of percentages in the cover_statistics function. It makes accessing the values easier.
  • Add pycln as a new pre-commit hooks for removing unused imports.
  • Remove time zone info from the inputs to plot.signatures to avoid issues with the matplotlib backend.

Bug Fixes

  • Fix an issue in plot.signatures where the new matplotlib version requires a numpy array instead of a pandas.DataFrame.

v0.12.3

15 Jan 18:35
Compare
Choose a tag to compare

Release Notes

Bug Fixes

  • Replace no data values of data in ssebopeta_bygeom with np.nan before converting it to mm/day.
  • Fix an inconsistency issue with CRS projection when using UTM in nlcd_*. Use EPSG:3857 for all reprojections and get the data from NLCD in the same projection. (:issue_hydro:[85]{.title-ref})
  • Improve performance of nlcd_* functions by reducing number of service calls.

Internal Changes

  • Add type checking with typeguard and fix type hinting issues raised by typeguard.
  • Refactor show_versions to ensure getting correct versions of all dependencies.

v0.12.2

31 Dec 21:28
Compare
Choose a tag to compare

Release Notes

New Features

  • The NWIS.get_info now returns a geopandas.GeoDataFrame instead of a pandas.DataFrame.

Bug Fixes

  • Fix a bug in NWIS.get_streamflow where the drainage area might not be computed correctly if target stations are not located at the outlet of their watersheds.

v0.12.1

31 Dec 07:48
Compare
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.

Bug Fixes

  • Fix an in issue with NWIS.get_streamflow where time zone of the data was not being correctly determined when it was US specific abbreviations such as CST.