Skip to content

Commit bcc18c5

Browse files
authored
Deprecate ginga_plugins. (#413)
Deprecate ginga_plugins.
1 parent 88ae68b commit bcc18c5

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ sbpy.names
1111
to be implemented by the MPC in anticipation of higher asteroid discovery
1212
rates in the LSST survey era [#406]
1313

14+
API Changes
15+
-----------
16+
- Deprecated `sbpy.ginga_plugins` in favor of using `sbpy-ginga` at
17+
https://github.com/NASA-Planetary-Science/sbpy-ginga [#413]
18+
1419

1520
Other Changes and Additions
1621
---------------------------

sbpy/ginga_plugins/CometaryEnhancements.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from warnings import warn
1010
from sbpy.exceptions import OptionalPackageUnavailable
11+
from astropy.utils.decorators import deprecated
1112

1213
try:
1314
from ginga.GingaPlugin import LocalPlugin
@@ -30,6 +31,7 @@ class LocalPlugin:
3031
from sbpy.imageanalysis import CometaryEnhancement
3132

3233

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

@@ -130,6 +132,14 @@ def build_gui(self, container):
130132

131133
vbox.add_widget(tabw)
132134

135+
# Add a deprecation warning
136+
hbox = Widgets.HBox()
137+
text_area = Widgets.TextArea()
138+
text_area.append_text("This tool is from the deprecated sbpy.ginga_plugins "
139+
"module. Use the sbpy-ginga module instead.")
140+
hbox.add_widget(text_area)
141+
vbox.add_widget(hbox)
142+
133143
# scroll bars will allow lots of content to be accessed
134144
top.add_widget(sw, stretch=1)
135145

sbpy/ginga_plugins/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from warnings import warn
44

5-
from astropy.utils.exceptions import AstropyWarning
5+
from astropy.utils.exceptions import AstropyWarning, AstropyDeprecationWarning
66

77
try:
88
from ginga.misc.Bunch import Bunch
@@ -13,6 +13,12 @@
1313

1414
Bunch = None
1515

16+
warn(
17+
"sbpy.ginga_plugins is deprecated. Use the `sbpy_ginga` module instead.",
18+
AstropyDeprecationWarning,
19+
stacklevel=2,
20+
)
21+
1622
# path to these plugins
1723
p_path = os.path.split(__file__)[0]
1824

0 commit comments

Comments
 (0)