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

Fixed compatibility with the latest stable version of ginga #797

Merged
merged 5 commits into from
Nov 20, 2015
Merged
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
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
- NO_CFG_FILES=false
- QT_PKG=pyqt
- CONDA_DEPENDENCIES="pip scipy cython h5py pygments pyzmq scikit-image pandas sphinx=1.2.3 xlrd pillow pytest mock coverage pyyaml requests sphinx_rtd_theme"
- PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli"
- PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli ginga"
- secure: NvQVc3XmmjXNVKrmaD31IgltsOImlnt3frAl4wU0pM223iejr7V57hz/V5Isx6sTANWEiRBMG27v2T8e5IiB7DQTxFUleZk3DWXQV1grw/GarEGUawXAgwDWpF0AE/7BRVJYqo2Elgaqf28+Jkun8ewvfPCiEROD2jWEpnZj+IQ=
- secure: "SU9BYH8d9eNigypG3lC83s0NY6Mq9AHGKXyEGeXDtz1npJIC1KHdzPMP1v1K3dzCgl1p6ReMXPjZMCENyfNkad/xvzTzGk0Nu/4BjihrUPV6+ratVeLpv0JLm8ikh8q+sZURkdtzUOlds+Hfn5ku4LdpT87tcKHY9TINAGA34ZM="
- AWS_ACCESS_KEY_ID: AKIAI2ERWDHLW3W24X3A
Expand All @@ -35,6 +35,8 @@ matrix:
- os: linux
env:
- PYTHON_VERSION=2.6 IPYTHON_VERSION=1 MPL_VERSION=1.4 ASTROPY_VERSION=0.4
# We don't test ginga with Python 2.6 since it is not supported
- PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli"

# Astropy dev
- os: linux
Expand All @@ -45,6 +47,8 @@ matrix:
- os: linux
env:
- PYTHON_VERSION=2.7 MPL_VERSION=1.5 NUMPY_VERSION=1.10 ASTROPY_VERSION=1.0 QT_PKG=pyqt5
# We don't test ginga with PyQt5 due to a bug in ginga with QT_API
- PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli"

# The following configuration tests that glue functions with minimal
# dependencies. The --no-deps is to prevent scipy from getting
Expand All @@ -66,7 +70,6 @@ matrix:
- ASTROPY_VERSION=1.0
- DOC_TRIGGER=1
- APP_TRIGGER=1
- GINGA=1
- PYTEST_ARGS="--cov glue --no-optional-skip"
- NO_CFG_FILES=true

Expand Down Expand Up @@ -128,9 +131,6 @@ install:

- LC_ALL=C

# Install latest developer version of Ginga
- if [[ $GINGA ]]; then pip install $PIP_ARGS https://github.com/glue-viz/ginga/archive/master.zip; fi

# Uninstall PyQt if we are using PySide or PyQt5
- if [ $QT_PKG == pyside ]; then conda remove pyqt sip || true; fi
- if [ $QT_PKG == pyqt5 ]; then conda remove pyqt qt || true; fi
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ v0.6 (unreleased)

* Fix bug that caused viewers to be restored with the wrong size. [#781, #783]

* Fixed compatibility with the latest stable version of ginga. [#797]

* Prevent axes from moving around when data viewers are being resized, and
instead make the absolute margins between axes and figure edge fixed. [#745]

Expand Down
13 changes: 11 additions & 2 deletions glue/plugins/ginga_viewer/qt_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
from ...external.qt.QtCore import Qt, QSize

from ginga.qtw.ImageViewCanvasQt import ImageViewCanvas
from ginga.qtw import Readout, ColorBar
from ginga.qtw import ColorBar

try:
from ginga.gw import Readout
except ImportError: # older versions of ginga
from ginga.qtw import Readout

from ginga.misc import log
from ginga import cmap as ginga_cmap
# ginga_cmap.add_matplotlib_cmaps()
Expand Down Expand Up @@ -104,7 +110,10 @@ def make_central_widget(self):
layout.setSpacing(0)
layout.addWidget(self.canvas.get_widget(), stretch=1)
layout.addWidget(self.colorbar, stretch=0)
layout.addWidget(self.readout.get_widget(), stretch=0)
try:
layout.addWidget(self.readout.get_widget(), stretch=0)
except TypeError: # recent versions of ginga
layout.addWidget(self.readout.get_widget().get_widget(), stretch=0)
topw.setLayout(layout)
return topw

Expand Down