From 22704893dcfcd0f3d14289abec681d2b609c8a75 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:32:10 -0800 Subject: [PATCH 01/11] fix pytest v9 typing issue --- CHANGELOG.md | 5 +++++ openoa/__init__.py | 2 +- test/conftest.py | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c10559a0..292601c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. If you make a notable change to the project, please add a line describing the change to the "unreleased" section. The maintainers will make an effort to keep the [Github Releases](https://github.com/NREL/OpenOA/releases) page up to date with this changelog. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## v3.1.4 - 2025-12-01 + +- During the custom test collection, convert the `Path` objects to `str` to avoid issues with the + type enforcement of `list[str]` for `args` in Pytest v9. + ## v3.1.3 - 2025-01-31 - Pin SciPy to >= 1.7 and <1.14 to avoid an incompatibility error with PyGAM. diff --git a/openoa/__init__.py b/openoa/__init__.py index 6a4b760a..1e1df7cc 100644 --- a/openoa/__init__.py +++ b/openoa/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.1.3" +__version__ = "3.1.4" """ When bumping version, please be sure to also update parameters in sphinx/conf.py diff --git a/test/conftest.py b/test/conftest.py index fd7ccdcf..dd24a7d3 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -25,8 +25,8 @@ def pytest_configure(config): regression = config.getoption("--regression") # Provide the appropriate directories - unit_tests = [el for el in (ROOT / "unit").iterdir() if el.suffix == ".py"] - regression_tests = [el for el in (ROOT / "regression").iterdir() if el.suffix == ".py"] + unit_tests = [str(el) for el in (ROOT / "unit").iterdir() if el.suffix == ".py"] + regression_tests = [str(el) for el in (ROOT / "regression").iterdir() if el.suffix == ".py"] # If both, run them all; if neither skip any modifications; otherwise run just the appropriate subset if regression and unit: From 65584e9343be61abf9a1628b1bc9f7d22d8c0774 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 08:58:33 -0800 Subject: [PATCH 02/11] update for python 3.14 support now that pygam is being updated again --- CHANGELOG.md | 5 ++++- pyproject.toml | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 292601c3..6208b781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ # Changelog All notable changes to this project will be documented in this file. If you make a notable change to the project, please add a line describing the change to the "unreleased" section. The maintainers will make an effort to keep the [Github Releases](https://github.com/NREL/OpenOA/releases) page up to date with this changelog. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## v3.1.4 - 2025-12-01 +## v3.1.4 - 2025-12-24 - During the custom test collection, convert the `Path` objects to `str` to avoid issues with the type enforcement of `list[str]` for `args` in Pytest v9. +- Update PyGAM minimum version for its latest update that includes Python 3.14 support. +- Remove maximum version pins for scipy and statsmodels with the support of the latest Python versions. +- Deprecate support for Python 3.8 and 3.9, with additional support for Python 3.12+. ## v3.1.3 - 2025-01-31 diff --git a/pyproject.toml b/pyproject.toml index 43d144c8..1ebd4d86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] authors = [{name = "NREL PRUF OA Team", email = "openoa@nrel.gov"}] readme = {file = "README.md", content-type = "text/markdown"} description = "A package for collecting and assigning wind turbine metrics" -requires-python = ">=3.8, <3.12" +requires-python = ">=3.10" license = {file = "LICENSE.txt"} dependencies = [ "scikit-learn>=1.0", @@ -18,10 +18,10 @@ dependencies = [ "shapely>=1.8", "numpy>=1.24", "pandas>=2.2", - "pygam>=0.9.0", - "scipy>=1.7,<1.14", + "pygam>=0.11.0", + "scipy>=1.7", "statsmodels>=0.11; python_version<'3.11'", - "statsmodels>=0.13.3; python_version=='3.11'", + "statsmodels>=0.13.3; python_version>='3.11'", "tqdm>=4.28.1", "matplotlib>=3.6", "bokeh>=3.3", @@ -50,10 +50,11 @@ classifiers = [ # https://pypi.org/classifiers/ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", From bec1da7cc2f81eb4aabff940d938e5438e501f69 Mon Sep 17 00:00:00 2001 From: Eric Simley Date: Wed, 19 Nov 2025 10:46:14 -0700 Subject: [PATCH 03/11] adding fill_value=False to shift function in filters.unresponsive_flag to get expected behavior at end of time series with NumPy v2 --- openoa/utils/filters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openoa/utils/filters.py b/openoa/utils/filters.py index a6757719..3d025e4d 100644 --- a/openoa/utils/filters.py +++ b/openoa/utils/filters.py @@ -103,7 +103,9 @@ def unresponsive_flag( flag = flag == 0 # Need to flag preceding `threshold` values as well - flag = flag | np.any([flag.shift(-1 - i, axis=0) for i in range(threshold - 1)], axis=0) + flag = flag | np.any( + [flag.shift(-1 - i, axis=0, fill_value=False) for i in range(threshold - 1)], axis=0 + ) # Return back a pd.Series if one was provided, else a pd.DataFrame return flag[col[0]] if to_series else flag From 42fb30f2278db5057050ffffcdb7bb34a5eecec5 Mon Sep 17 00:00:00 2001 From: Eric Simley Date: Wed, 19 Nov 2025 11:03:02 -0700 Subject: [PATCH 04/11] change np.Inf to np.inf in timeseries tests for compatibility with NumPy v2 --- test/unit/test_timeseries_toolkit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/test_timeseries_toolkit.py b/test/unit/test_timeseries_toolkit.py index 36d66e48..7260e84b 100644 --- a/test/unit/test_timeseries_toolkit.py +++ b/test/unit/test_timeseries_toolkit.py @@ -145,8 +145,8 @@ def test_percent_nan(self): test_dict = {} # All should be float Series given PlantData requirements - test_dict["a"] = pd.Series([True, 1, 2, 1e5, np.Inf]).astype(float) - test_dict["b"] = pd.Series([False, np.nan, 2, 1e5, np.Inf]).astype(float) + test_dict["a"] = pd.Series([True, 1, 2, 1e5, np.inf]).astype(float) + test_dict["b"] = pd.Series([False, np.nan, 2, 1e5, np.inf]).astype(float) test_dict["c"] = pd.Series([np.nan, 1, 2, 1e5, np.nan]).astype(float) nan_values = {"a": 0.0, "b": 0.2, "c": 0.4} From e38cfd076536256299e20c1b84babdcf7cf90962 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 09:50:06 -0800 Subject: [PATCH 05/11] fix scikit-learn max version for unsupported functionality in pygam --- CHANGELOG.md | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6208b781..a777a046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. If you make type enforcement of `list[str]` for `args` in Pytest v9. - Update PyGAM minimum version for its latest update that includes Python 3.14 support. - Remove maximum version pins for scipy and statsmodels with the support of the latest Python versions. +- Adds a maximum version for scikit-learn for a change in their `__sklearn_tags__` support. - Deprecate support for Python 3.8 and 3.9, with additional support for Python 3.12+. ## v3.1.3 - 2025-01-31 diff --git a/pyproject.toml b/pyproject.toml index 1ebd4d86..63c382f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ description = "A package for collecting and assigning wind turbine metrics" requires-python = ">=3.10" license = {file = "LICENSE.txt"} dependencies = [ - "scikit-learn>=1.0", + "scikit-learn>=1.0,<1.7", "requests>=2.21.0", "eia-python>=1.22", "pyproj>=3.5", From 7da8d70fd81c94b9695e51753190d1fbe938601d Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 09:53:56 -0800 Subject: [PATCH 06/11] udpate python in ci-tests --- .github/workflows/ci-tests.yml | 2 +- CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 9e1487e0..adb62332 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.9, 3.11] + python-version: [3.10, 3.14] steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index a777a046..32a40d9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. If you make - Remove maximum version pins for scipy and statsmodels with the support of the latest Python versions. - Adds a maximum version for scikit-learn for a change in their `__sklearn_tags__` support. - Deprecate support for Python 3.8 and 3.9, with additional support for Python 3.12+. +- Update the min and max versions to test in the testing CI workflow. ## v3.1.3 - 2025-01-31 From 395293d094e2e272dbc4a0a8bb31e22419b81591 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 09:55:57 -0800 Subject: [PATCH 07/11] convert python versions to strings --- .github/workflows/ci-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index adb62332..2cffd60b 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.10, 3.14] + python-version: ["3.10", "3.14"] steps: - uses: actions/checkout@v4 From 5d0edbb0645a1515b86ac9d1e74b1747c024203b Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 10:50:13 -0800 Subject: [PATCH 08/11] attempt sklearn 1.5.x --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 63c382f8..55475e56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ description = "A package for collecting and assigning wind turbine metrics" requires-python = ">=3.10" license = {file = "LICENSE.txt"} dependencies = [ - "scikit-learn>=1.0,<1.7", + "scikit-learn>=1.0,<1.6", "requests>=2.21.0", "eia-python>=1.22", "pyproj>=3.5", From a501f4206b1e35b50bab0cc5a19dc5b89f769f4c Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 10:54:23 -0800 Subject: [PATCH 09/11] drop 3.14 support due to windows scikit-learn build issues --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 55475e56..e6a59a88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,10 +8,10 @@ dynamic = ["version"] authors = [{name = "NREL PRUF OA Team", email = "openoa@nrel.gov"}] readme = {file = "README.md", content-type = "text/markdown"} description = "A package for collecting and assigning wind turbine metrics" -requires-python = ">=3.10" +requires-python = ">=3.10,<3.14" license = {file = "LICENSE.txt"} dependencies = [ - "scikit-learn>=1.0,<1.6", + "scikit-learn>=1.0,<1.7", "requests>=2.21.0", "eia-python>=1.22", "pyproj>=3.5", From 29e40c50bda9055944f4f8d49411baf051cbd3f9 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 10:55:16 -0800 Subject: [PATCH 10/11] update CI runner --- .github/workflows/ci-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 2cffd60b..bbbdff13 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: ["3.10", "3.14"] + python-version: ["3.10", "3.13"] steps: - uses: actions/checkout@v4 From 1caf95c2ea3dfeaf8493c16fe152119db35868d4 Mon Sep 17 00:00:00 2001 From: "Hammond, Rob" <13874373+RHammond2@users.noreply.github.com> Date: Wed, 24 Dec 2025 11:03:09 -0800 Subject: [PATCH 11/11] update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32a40d9a..00356d79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,10 @@ All notable changes to this project will be documented in this file. If you make - During the custom test collection, convert the `Path` objects to `str` to avoid issues with the type enforcement of `list[str]` for `args` in Pytest v9. -- Update PyGAM minimum version for its latest update that includes Python 3.14 support. +- Update PyGAM minimum version for its latest update that includes Python 3.10-3.13 support. - Remove maximum version pins for scipy and statsmodels with the support of the latest Python versions. - Adds a maximum version for scikit-learn for a change in their `__sklearn_tags__` support. -- Deprecate support for Python 3.8 and 3.9, with additional support for Python 3.12+. +- Deprecate support for Python 3.8 and 3.9, with additional support for Python 3.12 and 3.13. - Update the min and max versions to test in the testing CI workflow. ## v3.1.3 - 2025-01-31