From 597e8562f45e62f8f87f08da8167aab06d85e84b Mon Sep 17 00:00:00 2001 From: Aldo Tapia Date: Mon, 18 Aug 2025 17:30:27 -0700 Subject: [PATCH 01/12] Update meteo_utils.py Added an Actual vapor pressure estimation when RH is not provided --- pyet/meteo_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyet/meteo_utils.py b/pyet/meteo_utils.py index 0e35c58..537f0a0 100644 --- a/pyet/meteo_utils.py +++ b/pyet/meteo_utils.py @@ -264,7 +264,11 @@ def calc_ea(tmean=None, tmax=None, tmin=None, rhmax=None, rhmin=None, rh=None, e es = calc_es(tmax=tmax, tmin=tmin) else: es = calc_e0(tmean) - return rh / 100 * es + if rh is None and tmin is not None: + ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 + else: + ea = rh / 100 * es + return ea def day_of_year(tindex): From 8090035afc1d5b8fcfed019088f99d9a38406099 Mon Sep 17 00:00:00 2001 From: Aldo Tapia Date: Mon, 18 Aug 2025 17:37:28 -0700 Subject: [PATCH 02/12] File black formatted --- pyet/meteo_utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyet/meteo_utils.py b/pyet/meteo_utils.py index 537f0a0..5842ea0 100644 --- a/pyet/meteo_utils.py +++ b/pyet/meteo_utils.py @@ -1,6 +1,4 @@ -"""The meteo_utils module contains utility functions for meteorological data. - -""" +"""The meteo_utils module contains utility functions for meteorological data.""" from numpy import cos, exp, isnan, log, pi, sin, tan from pandas import Series, to_numeric @@ -265,9 +263,9 @@ def calc_ea(tmean=None, tmax=None, tmin=None, rhmax=None, rhmin=None, rh=None, e else: es = calc_e0(tmean) if rh is None and tmin is not None: - ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 + ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 else: - ea = rh / 100 * es + ea = rh / 100 * es return ea From 10d14bfb2d8dfce0463ca99906b4e22736f3cbeb Mon Sep 17 00:00:00 2001 From: Martin Vonk <66305055+martinvonk@users.noreply.github.com> Date: Thu, 27 Nov 2025 21:37:33 +0100 Subject: [PATCH 03/12] small docstring and formulation update --- pyet/radiation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyet/radiation.py b/pyet/radiation.py index 54cfde5..a916c42 100644 --- a/pyet/radiation.py +++ b/pyet/radiation.py @@ -168,7 +168,7 @@ def hargreaves(tmean, tmax, tmin, lat, k=0.0135, method=0, clip_zero=True): lat: float/xarray.DataArray the site latitude [rad]. k: float, optional - calirbation coefficient [-]. + calibration coefficient [-]. method: float, optional 0 => after :cite:t:`jensen_evaporation_2016` 1 => after :cite:t:`mcmahon_estimating_2013`. @@ -208,10 +208,10 @@ def hargreaves(tmean, tmax, tmin, lat, k=0.0135, method=0, clip_zero=True): ra = ra.values[:, None, None] else: ra = ra.values - chs = 0.00185 * (tmax - tmin) ** 2 - 0.0433 * (tmax - tmin) + 0.4023 if method == 0: pet = k / 0.0135 * 0.0023 * (tmean + 17.8) * sqrt(tmax - tmin) * ra / lambd elif method == 1: + chs = 0.00185 * (tmax - tmin) ** 2 - 0.0433 * (tmax - tmin) + 0.4023 pet = k * chs * sqrt(tmax - tmin) * ra / lambd * (tmean + 17.8) else: raise Exception("Method can be either 0 or 1.") @@ -329,7 +329,7 @@ def makkink(tmean, rs, pressure=None, elevation=None, k=0.65, clip_zero=True): elevation: float/xarray.DataArray, optional the site elevation [m]. k: float, optional - calirbation coefficient [-]. + calibration coefficient [-]. clip_zero: bool, optional if True, replace all negative values with 0. From 00fe4225e35f85272f2d2c240dd7b66cb1182ff1 Mon Sep 17 00:00:00 2001 From: Michelle Nygren <33085494+bombilator@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:23:58 +0200 Subject: [PATCH 04/12] Update radiation.py removed tmean from extraterrestrial_r in function jensen_haise --- pyet/radiation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyet/radiation.py b/pyet/radiation.py index 54cfde5..6dd7830 100644 --- a/pyet/radiation.py +++ b/pyet/radiation.py @@ -104,7 +104,7 @@ def jensen_haise(tmean, rs=None, cr=0.025, tx=-3, lat=None, method=0, clip_zero= if lat is None: raise Exception("If you choose method == 1, provide lat!") index = get_index(tmean) - ra = extraterrestrial_r(index, lat, tmean) + ra = extraterrestrial_r(index, lat) pet = ra * (tmean + 5) / 68 / lambd else: raise Exception("Method can be either 0 or 1.") From e27e82bc846ad35b9fda240e2ad19362a0ed74c8 Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Fri, 1 May 2026 06:34:04 +0200 Subject: [PATCH 05/12] Update docs conf --- docs/conf.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index aba0714..2fbb989 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,9 +42,6 @@ copyright = "{}, M. Vremec, R.A. Collenteur".format(year) author = "M. Vremec, R.A. Collenteur" -# The full version, including alpha/beta/rc tags -release = "2020" - # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be @@ -106,8 +103,8 @@ class MyReferenceStyle(AuthorYearReferenceStyle): source_suffix = ".rst" -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -125,18 +122,24 @@ class MyReferenceStyle(AuthorYearReferenceStyle): # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_logo = "_static/logo.png" -html_use_smartypants = True html_show_sourcelink = True +html_context = { + "github_user": "pyet-org", + "github_repo": "pyet", + "github_version": "master", + "doc_path": "docs", +} + html_theme_options = { "use_edit_page_button": True, "header_links_before_dropdown": 6, "icon_links": [ { - "name": "GitHub", # Label for this link - "url": "https://github.com/pyet-org/pyet", # required - "icon": "fab fa-github-square", - "type": "fontawesome", # Default is fontawesome + "name": "GitHub", + "url": "https://github.com/pyet-org/pyet", + "icon": "fa-brands fa-square-github", + "type": "fontawesome", } ], } @@ -156,6 +159,7 @@ class MyReferenceStyle(AuthorYearReferenceStyle): nb_execution_allow_errors = True # Allow errors in notebooks, to see the error online nb_execution_mode = "auto" +nb_execution_timeout = 300 # seconds # Enable specific MyST extensions, such as "dollarmath" for math rendering myst_enable_extensions = [ From f7ef55bca49b7156555c6b8630f7eece493ac07d Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Fri, 1 May 2026 06:36:45 +0200 Subject: [PATCH 06/12] No pandas 3.0 --- .github/pull_request_template.md | 4 +++- pyproject.toml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 66361c7..0cbe468 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,7 @@ # Short Description Add a short description describing the pull request (PR) here. -# Checklist before PR can be merged: +## Checklist before PR can be merged: - [ ] closes issue #xxxx - [ ] is documented - [ ] Format code with [Black formatting](https://black.readthedocs.io) @@ -9,3 +9,5 @@ Add a short description describing the pull request (PR) here. - [ ] tests added / passed - [ ] Example Notebook (for new features) - [ ] Remove output for all notebooks with changes + +## Make sure to choose the "dev-branch" to merge your PR into. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0fbfbad..e43c835 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ requires-python = ">=3.10" dependencies = [ "numpy >= 1.16", "xarray >= 0.18.0", - "pandas >= 2.1", + "pandas >= 2.1,<3.0", ] classifiers = [ 'Development Status :: 5 - Production/Stable', @@ -57,7 +57,7 @@ rtd = [ "ipykernel", "pydata-sphinx-theme", "sphinx-gallery", - "sphinx>=3.1", + "sphinx>=4.0", "sphinxcontrib-bibtex", "matplotlib", "myst-nb", From c51d3178ae4f5d76be94d10ffa0be54b97bc3264 Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Fri, 1 May 2026 06:48:32 +0200 Subject: [PATCH 07/12] Update testfao56.py --- tests/testfao56.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testfao56.py b/tests/testfao56.py index f2234f7..f87a5f2 100644 --- a/tests/testfao56.py +++ b/tests/testfao56.py @@ -215,7 +215,7 @@ def test_extraterrestrial_r(self): def test_daylight_hours(self): # Based on Example 9, p. 47 FAO. - dayhours = et.daylight_hours(DatetimeIndex(["2015-09-03"]), -0.35) + dayhours = et.daylight_hours(DatetimeIndex(["2015-09-03"]), -0.35)[0] self.assertAlmostEqual(float(dayhours), 11.7, 1) def test_calc_rad_long(self): From e0db7f1cbe4555cad5d743e1c20aa70d6b2f632d Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Fri, 1 May 2026 06:50:26 +0200 Subject: [PATCH 08/12] Update version.py --- pyet/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyet/version.py b/pyet/version.py index bf4a910..866bccf 100644 --- a/pyet/version.py +++ b/pyet/version.py @@ -1,3 +1,3 @@ # This is the only location where the version will be written and changed. # Based on https://packaging.python.org/single_source_version/ -__version__ = "1.4.0" +__version__ = "1.5.0" From a7e16f0efad2c5ee280f7fea3955f6921a1571f3 Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Fri, 1 May 2026 06:52:13 +0200 Subject: [PATCH 09/12] Update pyproject.toml --- pyproject.toml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e43c835..d6f8398 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,9 +13,9 @@ authors = [ license = { file = "LICENSE" } requires-python = ">=3.10" dependencies = [ - "numpy >= 1.16", - "xarray >= 0.18.0", - "pandas >= 2.1,<3.0", + "numpy >= 1.24", + "xarray >= 2022.06", + "pandas >= 2.1", ] classifiers = [ 'Development Status :: 5 - Production/Stable', @@ -31,12 +31,12 @@ classifiers = [ ] [project.urls] -Source = "https://github.com/phydrus/pyet" -Tracker = "https://github.com/phydrus/pyet/issues" -Help = "https://github.com/phydrus/pyet/discussions" -homepage = "https://github.com/phydrus/pyet" -repository = "https://github.com/phydrus/pyet" -documentation = "https://github.com/phydrus/pyet/discussions" +Source = "https://github.com/pyet-org/pyet" +Tracker = "https://github.com/pyet-org/pyet/issues" +Help = "https://github.com/pyet-org/pyet/discussions" +homepage = "https://github.com/pyet-org/pyet" +repository = "https://github.com/pyet-org/pyet" +documentation = "https://pyet.readthedocs.io" [tool.setuptools.dynamic] version = { attr = "pyet.version.__version__" } @@ -53,11 +53,10 @@ testpaths = ["tests"] [project.optional-dependencies] rtd = [ "sphinx-autodoc-typehints", - "Ipython", + "ipython", "ipykernel", "pydata-sphinx-theme", - "sphinx-gallery", - "sphinx>=4.0", + "sphinx>=7.0", "sphinxcontrib-bibtex", "matplotlib", "myst-nb", From c40a8955f59e8acef9725c5f054e92a4cf55e6c9 Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Fri, 1 May 2026 20:24:16 +0200 Subject: [PATCH 10/12] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d6f8398..72c5788 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ requires-python = ">=3.10" dependencies = [ "numpy >= 1.24", "xarray >= 2022.06", - "pandas >= 2.1", + "pandas >= 2.1,<3.0", ] classifiers = [ 'Development Status :: 5 - Production/Stable', From 89ab9d68a796ce1c26503376c40e58b465a90380 Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Tue, 5 May 2026 11:21:52 +0200 Subject: [PATCH 11/12] Update xarray dependency version in pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 72c5788..4a0107e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ license = { file = "LICENSE" } requires-python = ">=3.10" dependencies = [ "numpy >= 1.24", - "xarray >= 2022.06", + "xarray >= 2024.06", "pandas >= 2.1,<3.0", ] classifiers = [ @@ -68,4 +68,4 @@ rtd = [ "scipy", "spotpy", "openpyxl" -] \ No newline at end of file +] From 18475f16002d27a65cd4cb4ca0e1639aafe003c4 Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Wed, 13 May 2026 07:50:35 +0200 Subject: [PATCH 12/12] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyet/meteo_utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyet/meteo_utils.py b/pyet/meteo_utils.py index e9d8dff..2be6218 100644 --- a/pyet/meteo_utils.py +++ b/pyet/meteo_utils.py @@ -261,8 +261,14 @@ def calc_ea(tmean=None, tmax=None, tmin=None, rhmax=None, rhmin=None, rh=None, e es = calc_es(tmax=tmax, tmin=tmin) else: es = calc_e0(tmean) - if rh is None and tmin is not None: - ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 + if rh is None: + if tmin is not None: + ea = calc_e0(tmin) # assuming Tdew close to Tmin, Allen 1998 + else: + raise ValueError( + "calc_ea requires either `rh` or `tmin` when `ea` is not " + "provided and `rhmax` is not used." + ) else: ea = rh / 100 * es return ea