diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31aad2b2c..a48605a2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.13", "3.14"] + python-version: ["3.13"] steps: - name: Checkout code diff --git a/CHANGELOG.md b/CHANGELOG.md index 803f8a9f5..60c249bf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.5.0-rc.1](https://github.com/sequential-parameter-optimization/spotforecast2-safe/compare/v0.4.15...v0.5.0-rc.1) (2026-02-11) + + +### Features + +* warnings ([7feeeb4](https://github.com/sequential-parameter-optimization/spotforecast2-safe/commit/7feeeb4662ecd410afa6c7eee978398a8252f7c6)) + ## [0.4.15](https://github.com/sequential-parameter-optimization/spotforecast2-safe/compare/v0.4.14...v0.4.15) (2026-02-11) diff --git a/pyproject.toml b/pyproject.toml index 92f9eb781..f149ab1bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "spotforecast2-safe" -version = "0.4.15" +version = "0.5.0-rc.1" description = "spotforecast2-safe (Core): Safety-critical time series forecasting for production" readme = "README.md" license = { text = "AGPL-3.0-or-later" } diff --git a/src/spotforecast2_safe/exceptions.py b/src/spotforecast2_safe/exceptions.py index 65a8410f5..8c120af72 100644 --- a/src/spotforecast2_safe/exceptions.py +++ b/src/spotforecast2_safe/exceptions.py @@ -353,18 +353,22 @@ class MissingValuesWarning(UserWarning): matrix generates missing values. Most machine learning models do not accept missing values, so the Forecaster's `fit' and `predict' methods may fail. + Args: + message (str): The message to display. + Examples: >>> import warnings + >>> from spotforecast2_safe.exceptions import MissingValuesWarning >>> warnings.warn( ... "Missing values detected in input data.", ... MissingValuesWarning ... ) # doctest: +SKIP """ - def __init__(self, message): + def __init__(self, message: str) -> None: self.message = message - def __str__(self): + def __str__(self) -> str: extra_message = ( "You can suppress this warning using: " "warnings.simplefilter('ignore', category=MissingValuesWarning)" diff --git a/tests/test_exceptions_examples.py b/tests/test_exceptions_examples.py new file mode 100644 index 000000000..a3f60cfc1 --- /dev/null +++ b/tests/test_exceptions_examples.py @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2026 bartzbeielstein +# SPDX-License-Identifier: AGPL-3.0-or-later + +import pytest +import warnings +from spotforecast2_safe.exceptions import MissingValuesWarning + + +def test_missing_values_warning_example(): + """ + Test the example from MissingValuesWarning docstring. + """ + with pytest.warns( + MissingValuesWarning, match="Missing values detected in input data." + ): + warnings.warn("Missing values detected in input data.", MissingValuesWarning)