From 3bfe800e4beb5bf20e01ce7375fb710d93905777 Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:59:59 +0000 Subject: [PATCH] MNT: deprecate the style module --- lib/cartopy/mpl/style.py | 4 ++++ lib/cartopy/tests/mpl/test_style.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/cartopy/mpl/style.py b/lib/cartopy/mpl/style.py index a7d86affc..5229a7a05 100644 --- a/lib/cartopy/mpl/style.py +++ b/lib/cartopy/mpl/style.py @@ -11,6 +11,10 @@ import warnings +warnings.warn('The style module is deprecated and will be removed in a future release.', + DeprecationWarning, stacklevel=2) + + # Define the matplotlib style aliases that cartopy can expand. # Note: This should not contain the plural aliases # (e.g. linewidths -> linewidth). diff --git a/lib/cartopy/tests/mpl/test_style.py b/lib/cartopy/tests/mpl/test_style.py index 3639d3a8b..be4df17f6 100644 --- a/lib/cartopy/tests/mpl/test_style.py +++ b/lib/cartopy/tests/mpl/test_style.py @@ -3,9 +3,14 @@ # This file is part of Cartopy and is released under the BSD 3-clause license. # See LICENSE in the root of the repository for full licensing details. +import warnings + import pytest -from cartopy.mpl import style + +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + from cartopy.mpl import style @pytest.mark.parametrize(