Releases: hyriver/pygeohydro
Releases · hyriver/pygeohydro
v0.13.6
Release Notes
Internal Changes
- Add the missing PyPi classifiers for the supported Python versions.
v0.13.5
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 withssebopeta_bycoords
since version 0.13.0.
Internal Changes
- Bump the minimum versions of
pygeoogc
andpygeoutils
to 0.13.5 and that ofasync-retriever
to 0.3.5.
v0.13.3
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 calledNID.stage_nid_inventory
that can be used to download the entire NID dataset and save it as afeather
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
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 inNWIS.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
Release Notes
New Features
- Add a new function called
get_us_states
to thehelpers
module for obtaining a GeoDataFrame of the US states. It has an optional argument for returning thecontiguous
states,continental
states,commonwealths
states, or USterritories
. The data are retrieved from the Census' Tiger 2021 database. - In the
NID
class keep thevalid_fields
property as apandas.Series
instead of alist
, so it can be searched easier via itsstr
accessor.
Internal Changes
- Refactor the
plot.signatures
function to useproplot
instead ofmatplotlib
. - Improve performance of
NWIS.get_streamflow
by not validating the layer name when instantiating theWaterData
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 tonumpy.nan
.
v0.13.0
Release Notes
New Features
- Add a new flag to
nlcd_*
functions calledssl
for disabling SSL verification. - Add a new function called
get_camels
for getting the CAMELS dataset. The function returns ageopandas.GeoDataFrame
that includes basin-level attributes for all 671 stations in the dataset and axarray.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 usingrioxarray
innlcd_bygeom
since the clipping operation ofrioxarray
uses this value as the fill value.
v0.12.4
Release Notes
Internal Changes
- Return a named tuple instead of a
dict
of percentages in thecover_statistics
function. It makes accessing the values easier. - Add
pycln
as a newpre-commit
hooks for removing unused imports. - Remove time zone info from the inputs to
plot.signatures
to avoid issues with thematplotlib
backend.
Bug Fixes
- Fix an issue in
plot.signatures
where the newmatplotlib
version requires anumpy
array instead of apandas.DataFrame
.
v0.12.3
Release Notes
Bug Fixes
- Replace no data values of data in
ssebopeta_bygeom
withnp.nan
before converting it to mm/day. - Fix an inconsistency issue with CRS projection when using UTM in
nlcd_*
. UseEPSG: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 bytypeguard
. - Refactor
show_versions
to ensure getting correct versions of all dependencies.
v0.12.2
Release Notes
New Features
- The
NWIS.get_info
now returns ageopandas.GeoDataFrame
instead of apandas.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
Release Notes
Internal Changes
- Use the three new
ar.retrieve_*
functions instead of the oldar.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 asCST
.