History¶
0.9.2 (unreleased)¶
PyGeoHydro¶
Rename
hydrodatapackage topygeohydrofor publication on JOSS.In
NWIS.get_info, drop rows that don’t have mean daily discharge data instead of slicing.Add support for the National Inventory of Dams (NID) via
get_nidfunction.Speed up Github Actions by using
mambaand caching.Improve
pipinstallation by addingpyproject.toml.
0.9.1 (2021-02-22)¶
PyGeoHydro¶
Fix an issue with
NWIS.get_infomethod where stations with False values as theirhcdn_2009value were returned asNoneinstead.
0.9.0 (2021-02-14)¶
Bump versions of packages across the stack to the same version.
PyGeoHydro¶
Use the new pynhd function for getting basins,
NLDI.get_basisn.Made
mypychecks more strict and added all the missing type annotations.
PyGeoOGC¶
Add support for query by point and multi-points to
ArcGISRESTful.bygeom.Add support for buffer distance to
ArcGISRESTful.bygeom.Add support for generating ESRI-based queries for points and multi-points to
ESRIGeomQuery.Add all the missing type annotations.
Update the Daymet url to version 4. You can check the release information here
Use
cytoolzlibrary for some of the operations for improving performance.Add
extentproperty toArcGISRESTfulclass that get the spatial extent of the service.Add url to
airmapservice for getting elevation data at 30 m resolution.
PyGeoUtils¶
Add
gtiff2filefor saving raster responses asgeotifffile(s).Fix an error in
_get_nodata_crsfor handling nodata value when its value in the source is None.Fix the warning during the
GeoDataFramegeneration injson2geodfwhen there is no geometry column in the input json.
PyNHD¶
Add a new function for getting basins geometries for a list of USGS station IDs. The function is a method of
NLDIclass calledget_basins. So, nowNLDI.getfeature_byidfunction does not have a basin flag. This change makes getting geometries easier and faster.Remove
characteristics_dataframemethod fromNLDIand made a standalone function callednhdplus_attrsfor accessing NHDPlus attributes directly from ScienceBase.Add a new argument to
topoogical_sortcallededge_attrthat allows to add attribute(s) to the returned Networkx Graph. By default it isNone.A new base class,
AGRBasefor connecting to ArcGISRESTful-based services such as National Map and EPA’s WaterGEOS.Add support for setting the buffer distance for the input geometries to
AGRBase.bygeom.Add
comid_byloctoNLDIclass for getting ComIDs of the closest flowlines from a list of lon/lat coordinates.Add
bydistancetoWaterDatafor getting features within a given radius of a point.Add support for using hydro or edits webs services for getting NHDPlus High-Resolution using
NHDPlusHRfunction. The new arguments areservicewhich acceptshydrooredits, andautos_switchflag for automatically switching to the other service if the ones passed byservicefails.
Py3DEP¶
Add support for saving maps as
geotifffile(s).Replace
Elevation Point Query Serviceservice withAirMapfor getting elevations for a list of coordinates in bulk sinceAirMapis much faster. The resolution ofAirMapis 30 m.Use
cytoolzfor some of the operations for improving performance.
PyDaymet¶
Update to version 4 of Daymet database. You can check the release information here
Add a new function called
get_bycoordsthat provides an alternative toget_bylocfor getting climate data at a single pixel. This new function uses THREDDS data server with NetCDF Subset Service (NCSS), and supports getting monthly and annual averages directly from the server. Note that this function will replaceget_bylocin the future. So consider migrating your code by replacingget_bylocwithget_bycoords. The input arguments ofget_bycoordsis very similar toget_bygeom. Another difference betweenget_bylocandget_bycoordsis column names whereget_bycoordsuses the units that are return by NCSS server.Add support for downloading mothly and annual summaries in addition to the daily time-scale. You can pass
time_scaleasdaily,monthly, orannualtoget_bygeomorget_bycoordsfunctions to download the respective summaries.Add support for getting climate data for Hawaii and Puerto Rico by passing
regiontoget_bygeomandget_bycoordsfunctions. The acceptable values arenafor CONUS,hifor Hawaii, andprfor Puerto Rico.
0.8.0 (2020-12-06)¶
Fixed the issue with WaterData due to the recent changes on the server side.
Updated the examples based on the latest changes across the stack.
Add support for multipolygon.
Remove the
fill_holeargument.Fix a warning in
nlcdregarding performing division on nan values.
0.7.2 (2020-8-18)¶
Enhancements¶
Replaced
simplejsonwithorjsonto speed-up JSON operations.Explicitly sort the time dimension of the
ssebopeta_bygeomfunction.
Bug fixes¶
Fix an issue with the
nlcdfunction where high resolution requests fail.
0.7.1 (2020-8-13)¶
New Features¶
Added a new argument to
plot.signaturesfor controlling the vertical position of the plot title, calledtitle_ypos. This could be useful for multi-line titles.
Bug fixes¶
Fixed an issue with the
nlcdfunction where none layers are not dropped and cause the function to fails.
0.7.0 (2020-8-12)¶
This version divides PyGeoHydro into six standalone Python libraries. So many of the changes listed below belong to the modules and functions that are now a separate package. This decision was made for reducing the complexity of the code base and allow the users to only install the packages that they need without having to install all the PyGeoHydro dependencies.
Breaking changes¶
The
servicesmodule is now a separate package called PyGeoOGCC and is set as a requirement for PyGeoHydro. PyGeoOGC is a leaner package with much less dependencies and is suitable for people who might only need an interface to web services.Unified function names for getting feature by ID and by box.
Combined
startandendarguments into atupleargument calleddatesacross the code base.Rewrote NLDI function and moved most of its classmethods to Station so now Station class has more cohesion.
Removed exploratory functionality of
ArcGISREST, since it’s more convenient to do so from a browser. Now,base_urlis a required arguments.Renamed
in_crsindatasetsandservicesfunctions togeo_crsfor geometry andbox_crsfor bounding box inputs.Re-wrote the
signaturesfunction from scratch usingNamedTupleto improve readability and efficiency. Now, thedailyargument should be just apandas.DataFrameorpandas.Seriesand the column names are used for legends.Removed
utils.geom_maskfunction and replaced it withrasterio.mask.mask.Removed
widthas an input in functions with raster output sinceresolutionis almost always the preferred way to request for data. This change made the code more readable.Renamed two functions:
ArcGISRESTfulandwms_bybox. These function now returnrequests.Responsetype output.onlyipv4is now a class method inRetrySession.The
plot.signaturesfunction now assumes that the input time series are in mm/day.Added a flag to
get_streamflowfunction in theNWISclass to convert from cms to mm/day which is useful for plotting hydrologic signatures using thesignaturesfunctions.
Enhancements¶
Remove soft requirements from the env files.
Refactored
requestsfunctions into a single class and a separate file.Made all the classes available directly from
pygeohydro.Added CodeFactor to the Github pipeline and addressed the some of issues that CodeFactor found.
Added Bandit to check the code for secutiry issue.
Improved docstrings and documentations.
Added customized exceptions for better exception handling.
Added
pytestfixtures to improve the tests speed.Refactored
daymetandnwis_siteinfofunctions to reduce code complexity and improve readability.Major refactoring of the code base while adding type hinting.
The input geometry (or bounding box) can be provided in any projection and the necessary re-projections are done under the hood.
Refactored the method for getting object IDs in
ArcGISRESTclass to improve robustness and efficiency.Refactored
Daymetclass to improve readability.Add Deepsource for further code quality checking.
Automatic handling of large WMS requests (more than 8 million pixel i.e., width x height)
The
json_togeodffunction now accepts both a single (Geo)JSON or a list of themRefactored
plot.signaturesusingadd_gridspecfor a much cleaner code.
New Features¶
Added access to WaterData’s Geoserver databases.
Added access to the remaining NLDI database (Water Quality Portal and Water Data Exchange).
Created a Binder for launching a computing environment on the cloud and testing PyGeoHydro.
Added a URL repository for the supported services called
ServiceURLAdded support for FEMA web services for flood maps and FWS for wetlands.
Added a new function called
wms_toxarrayfor converting WMS request responses toxarray.DataArrayorxarray.Dataset.
Bug fixes¶
Re-projection issues for function with input geometry.
Start and end variables not being initialized when coords was used in
Station.Geometry mask for
xarray.DataArrayWMS output re-projections
0.6.0 (2020-06-23)¶
Refactor requests session
Improve overall code quality based on CodeFactor suggestions
Migrate to Github Actions from TravisCI
0.5.5 (2020-06-03)¶
Add to conda-forge
Remove pqdm and arcgis2geojson dependencies
0.5.3 (2020-06-07)¶
Added threading capability to the flow accumulation function
Generalized WFS to include both by bbox and by featureID
Migrate RTD to pip from conda
Changed HCDN database source to GagesII database
Increased robustness of functions that need network connections
Made the flow accumulation output a pandas Series for better handling of time series input
Combined DEM, slope, and aspect in a class called NationalMap.
Installation from pip installs all the dependencies
0.5.0 (2020-04-25)¶
An almost complete re-writing of the code base and not backward-compatible
New website design
Added vector accumulation
Added base classes and function accessing any ArcGIS REST, WMS, WMS service
Standalone functions for creating datasets from responses and masking the data
Added threading using pqdm to speed up the downloads
Interactive map for exploring USGS stations
Replaced OpenTopography with 3DEP
Added HCDN database for identifying natural watersheds
0.4.4 (2020-03-12)¶
Added new databases: NLDI, NHDPLus V2, OpenTopography, gridded Daymet, and SSEBop
The gridded data are returned as xarray DataArrays
Removed dependency on StreamStats and replaced it by NLDI
Improved overall robustness and efficiency of the code
Not backward comparable
Added code style enforcement with isort, black, flake8 and pre-commit
Added a new shiny logo!
New installation method
Changed OpenTopography base url to their new server
Fixed NLCD legend and statistics bug
0.3.0 (2020-02-10)¶
Clipped the obtained NLCD data using the watershed geometry
Added support for specifying the year for getting NLCD
Removed direct NHDPlus data download dependency buy using StreamStats and USGS APIs
Renamed get_lulc function to get_nlcd
0.2.0 (2020-02-09)¶
Simplified import method
Changed usage from
rstformat toipynbAutoo-formatting with the black python package
Change docstring format based on Sphinx
Fixed pytest warnings and changed its working directory
Added an example notebook with datafiles
Added docstring for all the functions
Added Module section to the documentation
Fixed py7zr issue
Changed 7z extractor from pyunpack to py7zr
Fixed some linting issues.
0.1.0 (2020-01-31)¶
First release on PyPI.