- Use a more efficient and reliable approach for adding elevation data to the climate dataset for computing PET. We now directly use 30-m elevation data from 3DEP and resample it to the climate data resolution by averaging each cell within a 1-km window.
- Drop support for Python 3.8 since its end-of-life date is October 2024.
- Remove all exceptions from the main module and raise them from the
exceptions
module. This is to declutter the public API and make it easier to maintain.
- A release without change to match the version of other HyRiver packages.
- In
get_bystac
function, only three variables were being returned regardless of the input variables. This version fixes this issue by returning all the requested variables.
- Add the
exceptions
module to the high-level API to declutter the main module. In the future, all exceptions will be raised from this module and not from the main module. For now, the exceptions are raised from both modules for backward compatibility. - Switch to using the
src
layout instead of theflat
layout for the package structure. This is to make the package more maintainable and to avoid any potential conflicts with other packages.
- Add a new function for getting Daymet data from Microsoft's
Planetary Computer
called
get_bystac
. Although this function can be much faster thanget_bygeom
, currently, it gives access to Daymet v4.2 from 1980 to 2020. As discussed here, the Daymet v4.5 will be added to the Planetary Computer in the future. Until then, for accessing the latest version of Daymet (v4.5) you need to useget_bygeom
. Additionally, this function requiresfsspec
,dask
,zarr
, andpystac-client
packages. - Make
separate_snow
a standalone, pure, and public function. Now, it can be used like so:pydaymet.separate_snow
. - Change the length unit from
km
tom
forget_bygeom
.
- The
potential_et
function usespy3dep.add_elevation
function but the CRS info gets lost in the process for the newelevation
variable. This version fixes this issue by adding the CRS info to theelevation
variable. - Change
PetParams
class fromNamedTuple
todataclass
for better performance and consistency. Now, it has a newclassmethod
calledfields
that returns a list of the four fields of the class.
- Bump min version of
shapely
to 2.
- Use the new
py3dep.add_elevation
API.
- Remove dependency on
dask
.
- Fix HyRiver libraries requirements by specifying a range instead
of exact version so
conda-forge
can resolve the dependencies.
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.
- For now, retain compatibility with
shapely<2
while supportingshapley>=2
.
- Change missing value of both single-pixel and gridded
versions to
numpy.nan
from -9999. - Add a new model parameter for computing PET using
priestlet_taylor
andpenman_monteith
models calledarid_correction
. For arid regions, FAO 56 suggests subtracting the min temperature by 2 degrees. This parameter can be passed viapet_params
indaymet_by*
functions, orparams
inpotential_pet
function. - Refactor
get_bycoords
to reduce memory usage by using a combination ofitertools
andGenerator
objects. - Refactor the
pet
module to improve performance and readability, and reduce code duplication.
- Add more information about parameters that
pet
functions accept.
- Bump the minimum required version of
shapely
to 2.0, and use its new API.
- Sync all minor versions of HyRiver packages to 0.14.0.
- Fully migrate
setup.cfg
andsetup.py
topyproject.toml
. - Convert relative imports to absolute with
absolufy-imports
. - Sync all patch versions of HyRiver packages to x.x.12.
- Refactor the
show_versions
function to improve performance and print the output in a nicer table-like format.
- Fix a bug in
get_bygeom
where for small requests that lead to a single download URL, the function failed.
- Skip 0.13.9 version so the minor version of all HyRiver packages become the same.
- More robust handling of getting large gridded data. Instead of caching the requests/
responses, directly store the responses as NetCDF files to a cache folder using
pygeoogc.streaming_download
and ultimately read them usingxarray.open_mfdataset
. This should make thebygeom
function even faster than before and also make it possible to make large requests without having to worry about running out of memory (:issue_day:`59`). - Modify the codebase based on Refurb suggestions.
Since the release of Daymet v4 R1 on November 2022, the URL of Daymet's server has been changed. Therefore, only PyDaymet v0.13.7+ is going to work, and previous versions will not work anymore.
- Add support for passing a list of coordinates to the
get_bycoords
function. Also, optionally, you can pass a list of IDs for the input coordinates that will be used askeys
for the returnedpandas.DataFrame
or a dimension calledid
in the returnedxarray.Dataset
ifto_xarray
is enabled. - Add a new argument called
to_xarray
to theget_bycoords
function for returning the results as axarray.Dataset
instead of apandas.DataFrame
. When set toTrue
, the returnedxarray.Dataset
will have three attributes calledunits
,description
, andlong_name
. - The
date
argument of bothget_bycoords
andby_geom
functions now acceptsrange
-type objects for passing years, e.g.,range(2000-2005)
.
import pydaymet as daymet
coords = [(-94.986, 29.973), (-95.478, 30.134)]
idx = ["P1", "P2"]
clm = daymet.get_bycoords(coords, range(2000, 2021), coords_id=idx, to_xarray=True)
- Use
pyupgrade
package to update the type hinting annotations to Python 3.10 style. - Fix the Daymet server URL.
- Add the missing PyPi classifiers for the supported Python versions.
- Append "Error" to all exception classes for conforming to PEP-8 naming conventions.
- Bump the minimum versions of
pygeoogc
,pygeoutils
,py3dep
to 0.13.5 and that ofasync-retriever
to 0.3.5.
- Fix a bug in
PETGridded
where the wrong data type was being set forpet
andelevation
variables. - When initializing
PETGridded
, only chunk the elevation if the input climate data is chunked.
- 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.
- Use micromamba for running tests and use nox for linting in CI.
- Adopt the default snow parameters' values from a new source https://doi.org/10.5194/gmd-11-1077-2018 and add the citation.
- Set the end year based on the current year since Daymet data get updated every year (:pull_day:`55`) by Tim Cera.
- Set the months for the annual timescale to correct values (:pull_day:`55`) by Tim Cera.
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"
- Add a new flag to both
get_bycoords
andget_bygeom
functions calledsnow
which separates snow from the precipitation using the Martinez and Gupta (2010) method.
- Add elevation data when computing PET regardless of the
pet
method. - Match the chunk size of
elevation
with that of the climate data. - Drop
time
dimension fromelevation
,lon
, andlat
variables.
- Fix a bug in setting dates for monthly timescales. For monthly timescale Daymet calendar is at 15th or 16th of the month, so input dates need to be adjusted accordingly.
- Clean up the PET computation functions' output by removing temporary variables that are created during the computation.
- Add more attributes for
elevation
andpet
variables. - Add type checking with
typeguard
and fixed typing issues raised bytypeguard
. - Refactor
show_versions
to ensure getting correct versions of all dependencies.
- Use the three new
ar.retrieve_*
functions instead of the oldar.retrieve
function to improve type hinting and to make the API more consistent.
- Expose the
ssl
argument for disabling the SSL certification verification (:issue_day:`41`). Now, you can passssl=False
to disable the SSL verification in bothget_bygeom
andget_bycoord
functions. Moreover, you can pass--disable_ssl
to PyDaymet's command line interface to disable the SSL verification.
- Set the request caching's expiration time to never expire. Add two flags to all
functions to control the caching:
expire_after
anddisable_caching
.
- Add all the missing types so
mypy --strict
passes.
- Use
importlib-metadata
for getting the version instead ofpkg_resources
to decrease import time as discussed in this issue.
- There was an issue in the PET computation due to
dayofyear
being added as a new dimension. This version fixes it and even further simplifies the code by usingxarray
'sdt
accessor to gain access to thedayofyear
method.
- Add
hargreaves_samani
andpriestley_taylor
methods for computing PET.
- Rewrite the command-line interface using
click.group
to improve UX. The command is nowpydaymet [command] [args] [options]
. The two supported commands arecoords
for getting climate data for a dataframe of coordinates andgeometry
for getting gridded climate data for a geo-dataframe. Moreover, Each sub-command now has a separate help message and example. - Deprecate
get_byloc
in favor ofget_bycoords
. - The
pet
argument in bothget_bycoords
andget_bygeom
functions now acceptshargreaves_samani
,penman_monteith
,priestley_taylor
, andNone
.
- Refactor the
pet
module for reducing duplicate code and improving readability and maintainability. The code is smaller now and the functions for computing physical properties include references to equations from the respective original paper.
The highlight of this release is a major refactor of Daymet
to allow for
extending PET computation function for using methods other than FAO-56.
- Refactor
Daymet
class by removingpet_bycoords
andpet_bygrid
methods and creating a new public function calledpotential_et
. This function computes potential evapotranspiration (PET) and supports both gridded (xarray.Dataset
) and single pixel (pandas.DataFrame
) climate data. The long-term plan is to add support for methods other than FAO 56 for computing PET.
- Add command-line interface (:issue_day:`7`).
- Use
AsyncRetriever
for sending requests asynchronously with persistent caching. A cache folder in the current directory is created. - Check for validity of start/end dates based on Daymet V4 since Puerto Rico data starts from 1950 while North America and Hawaii start from 1980.
- Check for validity of input coordinate/geometry based on the Daymet V4 bounding boxes.
- Improve accuracy of computing Psychometric constant in PET calculations by using an equation in Allen et al. 1998.
- Drop support for Python 3.6 since many of the dependencies such as
xarray
andpandas
have done so. - Change
loc_crs
andgeo_crs
arguments tocrs
inget_bycoords
andget_bygeom
.
- Add examples to docstrings and improve writing.
- Add more notes regarding the underlying assumptions for
pet_bycoords
andpet_bygrid
.
- Refactor
Daymet
class to usepydantic
for validating the inputs. - Increase test coverage.
- Add announcement regarding the new name for the software stack, HyRiver.
- Improve
pip
installation and release workflow.
- The first release after renaming hydrodata to PyGeoHydro.
- Make
mypy
checks more strict and fix all the errors and prevent possible bugs. - Speed up CI testing by using
mamba
and caching.
- Bump version to the same version as PyGeoHydro.
- Update to version 4 of Daymet database. You can check the release information here
- Add a new function called
get_bycoords
that provides an alternative toget_byloc
for 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_byloc
in the future. So consider migrating your code by replacingget_byloc
withget_bycoords
. The input arguments ofget_bycoords
is very similar toget_bygeom
. Another difference betweenget_byloc
andget_bycoords
is column names whereget_bycoords
uses the units that are return by NCSS server. - Add support for downloading monthly and annual summaries in addition to the daily
timescale. You can pass
time_scale
asdaily
,monthly
, orannual
toget_bygeom
orget_bycoords
functions to download the respective summaries. - Add support for getting climate data for Hawaii and Puerto Rico by passing
region
toget_bygeom
andget_bycoords
functions. The acceptable values arena
for CONUS,hi
for Hawaii, andpr
for Puerto Rico.
- Add support for multipolygon.
- Remove the
fill_hole
argument. - Improve masking by geometry.
- Use the newly added
async_requests
function frompygeoogc
for getting Daymet data to increase the performance (almost 2x faster)
- Replaced
simplejson
withorjson
to speed-up JSON operations.
- Add
show_versions
for showing versions of the installed deps.
- Retained the compatibility with
xarray
0.15 by removing theattrs
flag. - Replaced
open_dataset
withload_dataset
for automatic handling of closing the input after reading the content. - Removed
years
argument from bothbyloc
andbygeom
functions. Thedates
argument now accepts both a tuple of start and end dates and a list of years.
- Initial release on PyPI.