Skip to content

Commit 8f39bd8

Browse files
committed
WIP: Building on astropy#126
1 parent 678a2e4 commit 8f39bd8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

astrowidgets/glupyter.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""Module containing ``astrowidgets`` implemented with ``glue-jupyter``
2+
(that uses ``bqplot``) backend.
3+
4+
For this to work, ``astrowidgets`` must be installed along with the optional
5+
dependencies specified for the ``glue-jupyter`` (a.k.a. Glupyter or
6+
``glupyter``) backend; e.g.,::
7+
8+
pip install 'astrowidgets[glupyter]'
9+
10+
"""
11+
from glue_jupyter import jglue
12+
13+
from astrowidgets.core import BaseImageWidget
14+
15+
__all__ = ['ImageWidget']
16+
17+
18+
class ImageWidget(BaseImageWidget):
19+
"""Image widget for Jupyter notebook using ``glue-jupyter``/``bqplot``
20+
viewer.
21+
22+
Parameters
23+
----------
24+
kwargs : dict
25+
See `~astrowidgets.core.BaseImageWidget`.
26+
27+
"""
28+
def __init__(self, **kwargs):
29+
super().__init__(**kwargs)
30+
31+
self._app = jglue()
32+
self._viewer = self._app.imshow()
33+
34+
# UNTIL HERE -- imshow errors out without data
35+
# TODO: This builds on PR 126. Example notebook in test_data/ztmp...
36+
37+
@property
38+
def viewer(self):
39+
self._viewer

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ ginga =
4545
ginga
4646
pillow
4747
aggdraw
48+
glupyter =
49+
glue-jupyter
4850
test =
4951
pytest-astropy
5052
pytest-cov

0 commit comments

Comments
 (0)