Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ginga_plugins. #413

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ sbpy.names
to be implemented by the MPC in anticipation of higher asteroid discovery
rates in the LSST survey era [#406]

API Changes
-----------
- Deprecated `sbpy.ginga_plugins` in favor of using `sbpy-ginga` at
https://github.com/NASA-Planetary-Science/sbpy-ginga [#413]


0.5.0 (2024-08-28)
==================
Expand Down
10 changes: 10 additions & 0 deletions sbpy/ginga_plugins/CometaryEnhancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from warnings import warn
from sbpy.exceptions import OptionalPackageUnavailable
from astropy.utils.decorators import deprecated

try:
from ginga.GingaPlugin import LocalPlugin
Expand All @@ -30,6 +31,7 @@
from sbpy.imageanalysis import CometaryEnhancement


@deprecated("0.6", alternative="sbpy_ginga.cometary_enhancements.CometaryEnhancements")
class CometaryEnhancements(LocalPlugin):
"""Ginga plugin for on-the-fly cometary image enhancements."""

Expand Down Expand Up @@ -130,6 +132,14 @@

vbox.add_widget(tabw)

# Add a deprecation warning
hbox = Widgets.HBox()
text_area = Widgets.TextArea()
text_area.append_text("This tool is from the deprecated sbpy.ginga_plugins "

Check warning on line 138 in sbpy/ginga_plugins/CometaryEnhancements.py

View check run for this annotation

Codecov / codecov/patch

sbpy/ginga_plugins/CometaryEnhancements.py#L136-L138

Added lines #L136 - L138 were not covered by tests
"module. Use the sbpy-ginga module instead.")
hbox.add_widget(text_area)
vbox.add_widget(hbox)

Check warning on line 141 in sbpy/ginga_plugins/CometaryEnhancements.py

View check run for this annotation

Codecov / codecov/patch

sbpy/ginga_plugins/CometaryEnhancements.py#L140-L141

Added lines #L140 - L141 were not covered by tests

# scroll bars will allow lots of content to be accessed
top.add_widget(sw, stretch=1)

Expand Down
8 changes: 7 additions & 1 deletion sbpy/ginga_plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from warnings import warn

from astropy.utils.exceptions import AstropyWarning
from astropy.utils.exceptions import AstropyWarning, AstropyDeprecationWarning

try:
from ginga.misc.Bunch import Bunch
Expand All @@ -13,6 +13,12 @@

Bunch = None

warn(
"sbpy.ginga_plugins is deprecated. Use the `sbpy_ginga` module instead.",
AstropyDeprecationWarning,
stacklevel=2,
)

# path to these plugins
p_path = os.path.split(__file__)[0]

Expand Down