From d31e001f93fc4e6e087fbcff662dfbe420337901 Mon Sep 17 00:00:00 2001 From: ManonMarchand Date: Mon, 30 Sep 2024 17:32:55 +0200 Subject: [PATCH] docs: document when deprecated methods will be removed [skip ci] --- CHANGELOG.md | 4 ++++ src/ipyaladin/widget.py | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53cfa6f..bca0350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- DeprecationWarning messages now clearly say that the methods won't exist in v1.0.0 + ### Added - it is now possible to extend the widget's height to 100% of its container. To do so, diff --git a/src/ipyaladin/widget.py b/src/ipyaladin/widget.py index bc4853d..c4d18f2 100644 --- a/src/ipyaladin/widget.py +++ b/src/ipyaladin/widget.py @@ -693,7 +693,8 @@ def add_moc_from_URL( """ warnings.warn( "add_moc_from_URL is replaced by add_moc that detects automatically" - "that the MOC was given as an URL.", + "that the MOC was given as an URL." + "This will be removed in version 1.0.0 (coming afer 0.5.1).", DeprecationWarning, stacklevel=2, ) @@ -719,7 +720,8 @@ def add_moc_from_dict( """ warnings.warn( "add_moc_from_dict is replaced by add_moc that detects automatically" - "that the MOC was given as a dictionary.", + "that the MOC was given as a dictionary." + "This will be removed in version 1.0.0 (coming afer 0.5.1).", DeprecationWarning, stacklevel=2, ) @@ -850,7 +852,8 @@ def add_overlay_from_stcs( """ warnings.warn( "'add_overlay_from_stcs' is deprecated, " - "use 'add_graphic_overlay_from_stcs' instead", + "use 'add_graphic_overlay_from_stcs' instead. " + "This will be removed in version 1.0.0 (coming afer 0.5.1).", DeprecationWarning, stacklevel=2, ) @@ -930,7 +933,8 @@ def rectangular_selection(self) -> None: This method is deprecated, use selection instead """ warnings.warn( - "rectangular_selection is deprecated, use selection('rectangle') instead", + "rectangular_selection is deprecated, use selection('rectangle') instead" + "This will be removed in version 1.0.0 (coming afer 0.5.1).", DeprecationWarning, stacklevel=2, ) @@ -983,7 +987,8 @@ def add_listener(self, listener_type: str, callback: Callable) -> None: """ warnings.warn( - "add_listener is deprecated, use set_listener instead", + "add_listener is deprecated, use set_listener instead" + "This will be removed in version 1.0.0 (coming afer 0.5.1).", DeprecationWarning, stacklevel=2, )