From b48fea95bf14074aae31e51e60168f558c60729c Mon Sep 17 00:00:00 2001 From: Roman Cattaneo <1116746+romanc@users.noreply.github.com> Date: Mon, 27 Oct 2025 10:47:37 +0100 Subject: [PATCH 1/2] BREAKING CHANGE: remove ndsl/exceptions The module has been deprecated last release and will be removed with this release. --- ndsl/__init__.py | 2 -- ndsl/exceptions.py | 16 ---------------- tests/mpi/test_mpi_mock.py | 2 +- tests/test_exceptions.py | 8 -------- 4 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 ndsl/exceptions.py delete mode 100644 tests/test_exceptions.py diff --git a/ndsl/__init__.py b/ndsl/__init__.py index c7730282..215ee14c 100644 --- a/ndsl/__init__.py +++ b/ndsl/__init__.py @@ -19,7 +19,6 @@ from .dsl.ndsl_runtime import NDSLRuntime from .dsl.stencil import FrozenStencil, GridIndexing, StencilFactory, TimingCollector from .dsl.stencil_config import CompilationConfig, RunMode, StencilConfig -from .exceptions import OutOfBoundsError from .halo.data_transformer import HaloExchangeSpec from .halo.updater import HaloUpdater, HaloUpdateRequest, VectorInterfaceHaloUpdater from .initialization import GridSizer, QuantityFactory, SubtileGridSizer @@ -62,7 +61,6 @@ "CompilationConfig", "RunMode", "StencilConfig", - "OutOfBoundsError", "HaloExchangeSpec", "HaloUpdater", "HaloUpdateRequest", diff --git a/ndsl/exceptions.py b/ndsl/exceptions.py deleted file mode 100644 index 4511ea69..00000000 --- a/ndsl/exceptions.py +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa -import warnings - -from ndsl.comm.local_comm import ConcurrencyError -from ndsl.units import UnitsError - - -class OutOfBoundsError(ValueError): - def __init__(self, *args) -> None: - warnings.warn( - "Usage of `OutOfBoundsError` is discouraged. The class will be " - "removed in the next version in favor of using the built-in `IndexError`.", - DeprecationWarning, - stacklevel=2, - ) - super().__init__(*args) diff --git a/tests/mpi/test_mpi_mock.py b/tests/mpi/test_mpi_mock.py index 0da2f21b..6436af02 100644 --- a/tests/mpi/test_mpi_mock.py +++ b/tests/mpi/test_mpi_mock.py @@ -3,7 +3,7 @@ from ndsl import DummyComm from ndsl.buffer import recv_buffer -from ndsl.exceptions import ConcurrencyError +from ndsl.comm.local_comm import ConcurrencyError from tests.mpi.mpi_comm import MPI diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py deleted file mode 100644 index f5d66eb7..00000000 --- a/tests/test_exceptions.py +++ /dev/null @@ -1,8 +0,0 @@ -import pytest - -from ndsl import OutOfBoundsError - - -def test_OutOfBoundsError_is_deprecation() -> None: - with pytest.deprecated_call(): - OutOfBoundsError("This should trigger a deprecation warning.") From 531f83ea2990b997c6314cc206220248277fe1ec Mon Sep 17 00:00:00 2001 From: Roman Cattaneo <1116746+romanc@users.noreply.github.com> Date: Mon, 27 Oct 2025 10:58:20 +0100 Subject: [PATCH 2/2] fixup: documentation --- docs/docstrings/top/exceptions.md | 3 --- mkdocs.yml | 1 - 2 files changed, 4 deletions(-) delete mode 100644 docs/docstrings/top/exceptions.md diff --git a/docs/docstrings/top/exceptions.md b/docs/docstrings/top/exceptions.md deleted file mode 100644 index 8803fee0..00000000 --- a/docs/docstrings/top/exceptions.md +++ /dev/null @@ -1,3 +0,0 @@ -# exceptions - -::: exceptions diff --git a/mkdocs.yml b/mkdocs.yml index 1ca8682c..34692b3f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,7 +24,6 @@ nav: - "boilerplate": docstrings/top/boilerplate.md - "buffer": docstrings/top/buffer.md - "constants": docstrings/top/constants.md - - "exceptions": docstrings/top/exceptions.md - "filesystem": docstrings/top/filesystem.md - "io": docstrings/top/io.md - "logging": docstrings/top/logging.md