Skip to content

Commit

Permalink
WIP: Building on astropy#126
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Feb 23, 2021
1 parent 678a2e4 commit 8f39bd8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions astrowidgets/glupyter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Module containing ``astrowidgets`` implemented with ``glue-jupyter``
(that uses ``bqplot``) backend.
For this to work, ``astrowidgets`` must be installed along with the optional
dependencies specified for the ``glue-jupyter`` (a.k.a. Glupyter or
``glupyter``) backend; e.g.,::
pip install 'astrowidgets[glupyter]'
"""
from glue_jupyter import jglue

from astrowidgets.core import BaseImageWidget

__all__ = ['ImageWidget']


class ImageWidget(BaseImageWidget):
"""Image widget for Jupyter notebook using ``glue-jupyter``/``bqplot``
viewer.
Parameters
----------
kwargs : dict
See `~astrowidgets.core.BaseImageWidget`.
"""
def __init__(self, **kwargs):
super().__init__(**kwargs)

self._app = jglue()
self._viewer = self._app.imshow()

# UNTIL HERE -- imshow errors out without data
# TODO: This builds on PR 126. Example notebook in test_data/ztmp...

@property
def viewer(self):
self._viewer
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ ginga =
ginga
pillow
aggdraw
glupyter =
glue-jupyter
test =
pytest-astropy
pytest-cov
Expand Down

0 comments on commit 8f39bd8

Please sign in to comment.