Releases: hyriver/pynhd
Releases · hyriver/pynhd
v0.15.2
Release Notes
Bug Fixes
- Update
GeoConnexbased on the latest changes in the web service.
v0.15.1
Release Notes
Bug Fixes
- Fix HyRiver libraries requirements by specifying a range instead of exact version so
conda-forgecan resolve the dependencies.
v0.15.0
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
- Add a new function, called
nhdplus_h12pp, for retrieving HUC12 pour points across CONUS. - Add
use_arrow=Truetopynhd.nhdplus_l48when reading the NHDPlus dataset. This speeds up the process sincepyarrowis installed. - In
nhdplus_l48makelayeroption sosqlparameter ofpyogrio.read_dataframecan also be used. This is necessary sincepyogrio.read_dataframedoes not support passing bothlayerandsqlparameters. - Update the mainstems dataset link to version 2.0 in
mainstem_huc12_nx. - Expose
NHDToolsclass to the public API. - For now, retain compatibility with
shapely<2while supportingshapley>=2.
Bug Fixes
- Remove unnecessary conversion of
id_colandtoid_coltoInt64innhdflw2nxandvector_accumulation. This ensures that the input data types are preserved. - Fix an issue in
nhdplus_l48, where if the inputdata_diris not absolutepy7zrfails to extract the file.
v0.14.0
Release Notes
New Features
- Rewrite the
GeoConnexclass to provide access to new capabilities of the web service. Support for spatial queries have been added via CQL queries. For more information, check out the updated GeoConnex example notebook. - Add a new property to
StreamCat, calledmetrics_dfthat gets a dataframe of metric names and their description. - Create a new private
StreamCatValidatorclass to avoid polluting the publicStreamCatclass with private attributes and methods. Moreover, add a new alternative metric names attribute toStreamCatcalledalt_namesfor handling those metric names that do not followMETRIC+YYYYconvention. This attribute is a dictionary that maps the alternative names to the actual metric names, so users can useMETRIC_NAMEcolumn ofmetrics_dfand add a year suffix fromvalid_yearsattribute ofStreamCatto get the actual metric name. - In
navigate_by*functions ofNLDIaddstop_comid, which is another criterion for stopping the navigation in addition todistance. - Improve
UserWarningmessages ofNLDIandWaterData.
Breaking Changes
- Remove
pynhd.geoconnexfunction since more functionality has been added to the GeoConnex service that existence of this function does not make sense anymore. All queries should be done viapynhd.GeoConnexclass. - Rewrite
NLDIto improve code readability and significantly improving performance. Now, its methods do now return tuples if there are failed requests, instead they will be shown as aUserWarning. - Bump the minimum required version of
shapelyto 2.0, and use its new API.
Internal Changes
- Sync all minor versions of HyRiver packages to 0.14.0.
v0.13.12
Release Notes
New Features
- Update the link to version 2.0 of the ENHD dataset in
enhd_attrs.
Internal Changes
- Improve columns data types in
enhd_attrsandnhdplus_vaaby usingint32instead ofInt64, where applicable. - Sync all patch versions of HyRiver packages to x.x.12.
v0.13.11
Release Notes
New Features
- The
prepare_nhdplusnow supports NHDPlus HR in addition to NHDPlus MR. It automatically detects the NHDPlus version based on the ID column name:nhdplusidfor HR andcomidfor MR.
Internal Changes
- Fully migrate
setup.cfgandsetup.pytopyproject.toml. - Convert relative imports to absolute with
absolufy-imports. - Improve performance of
prepare_nhdplusby usingpandas.mergeinstead of applying a function to each row of the dataframe.
v0.13.10
Release Notes
New Features
- Add support for the new EPA's StreamCat RestFull API with over 500 NHDPlus catchment level metrics. One class is added for getting the service properties such as valid metrics, called
StreamCat. You can usestreamcatfunction to get the metrics as apandas.DataFrame. - Refactor the
show_versionsfunction to improve performance and print the output in a nicer table-like format.
Internal Changes
- Skip 0.13.9 version so the minor version of all HyRiver packages become the same.
- Modify the codebase based on the latest changes in
geopandasrelated to empty dataframes.
v0.13.8
Release Notes
New Features
- Add a new function, called
nhdplus_attrs_s3, for accessing the recently released NHDPlus derived attributes on a USGS's S3 bucket. The attributes are provided in parquet files, so getting them is faster thannhdplus_attrs. Also, you can request for multiple attributes at once whereas innhdplus_attrsyou had to request for each attribute one at a time. This function will replacenhdplus_attrsin a future release, as soon as all data that are available on the ScienceBase version are also accessible from the S3 bucket. - Add two new functions called
mainstem_huc12_nxandenhd_flowlines_nx. These functions generate anetworkxdirected graph object of NHD HUC12 water boundaries and flowlines, respectively. They also return a dictionary mapping of COMID and HUC12 to the correspondingnetworkxnode. Additionally, a topologically sorted list of COMIDs/HUC12s are returned. The generated data are useful for doing US-scale network analysis and flow accumulation on the NHD network. The NHD graph has about 2.7 million edges and the mainstem HUC12 graph has about 80K edges. - Add a new function for getting the entire NHDPlus dataset for CONUS (Lower 48), called
nhdplus_l48. The entire NHDPlus dataset is downloaded from here. This 7.3 GB file will take a while to download, depending on your internet connection. The first time you run this function, the file will be downloaded and stored in the./cachedirectory. Subsequent calls will use the cached file. Moreover, there are two additional dependencies for using this function:pyogrioandpy7zr. These dependencies can be installed usingpip install pyogrio py7zrorconda install -c conda-forge pyogrio py7zr.
Internal Changes
- Refactor
vector_accumulationfor significant performance improvements. - Modify the codebase based on Refurb suggestions.
v0.13.7
Release Notes
New Features
- Add a new function called
epa_nhd_catchmentsto access one of the EPA's HMS endpoints calledWSCatchment. You can use this function to access 414 catchment-scale characteristics for all the NHDPlus catchments including 16-day average curve number. More information on the curve number dataset can be found at its project page here.
Bug Fixes
- Fix a bug in
NHDToolswhere due to the recent changes inpandasexception handling, theNHDToolsfails in converting columns withNaNvalues to integer type. Now,pandasthrowsIntCastingNaNErrorinstead ofTypeErrorwhen usingastypemethod on a column.
Internal Changes
- Use
pyupgradepackage to update the type hinting annotations to Python 3.10 style.
v0.13.6
Release Notes
Internal Changes
- Add the missing PyPi classifiers for the supported Python versions.