Skip to content

Commit 2dd251f

Browse files
committed
Deprecate use_opencv parameter
The use_opencv parameter has been deprecated in ginga; opencv will be used automatically if it is installed.
1 parent 3382c7e commit 2dd251f

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

astrowidgets/core.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ class ImageWidget(ipyw.VBox):
4848
image_width, image_height : int
4949
Dimension of Jupyter notebook's image widget.
5050
51-
use_opencv : bool
52-
Let Ginga use ``opencv`` to speed up image transformation;
53-
e.g., rotation and mosaic. If this is enabled and you
54-
do not have ``opencv``, you will get a warning.
55-
5651
pixel_coords_offset : int, optional
5752
An offset, typically either 0 or 1, to add/subtract to all
5853
pixel values when going to/from the displayed image.
@@ -62,16 +57,13 @@ class ImageWidget(ipyw.VBox):
6257
"""
6358

6459
def __init__(self, logger=None, image_width=500, image_height=500,
65-
use_opencv=True, pixel_coords_offset=0):
60+
pixel_coords_offset=0, **kwargs):
6661
super().__init__()
6762

68-
# TODO: Is this the best place for this?
69-
if use_opencv:
70-
try:
71-
from ginga import trcalc
72-
trcalc.use('opencv')
73-
except ImportError:
74-
warnings.warn('install opencv or set use_opencv=False')
63+
if 'use_opencv' in kwargs:
64+
warnings.warn("use_opencv kwarg has been deprecated--"
65+
"opencv will be used if it is installed",
66+
DeprecationWarning)
7567

7668
self._viewer = EnhancedCanvasView(logger=logger)
7769

0 commit comments

Comments
 (0)