Skip to content

Commit

Permalink
Update minimum required Astropy version to 1.0 and IPython to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Aug 15, 2016
1 parent 5b3dba7 commit 0df6ab3
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 60 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,11 @@ matrix:

- os: linux
env:
- PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.3 ASTROPY_VERSION=0.3 NUMPY_VERSION=1.8
- PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.3 NUMPY_VERSION=1.8

- os: linux
env:
- PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.4 ASTROPY_VERSION=0.4 NUMPY_VERSION=1.9 IPYTHON_VERSION=1.1

- os: linux
env:
- PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.4 ASTROPY_VERSION=0.4 NUMPY_VERSION=1.9 IPYTHON_VERSION=0.13
- PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.4 NUMPY_VERSION=1.9 IPYTHON_VERSION=1.1

# Test with PySide, but due to segmentation faults, mark as an
# allowed failure.
Expand Down
9 changes: 5 additions & 4 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ field and click on **Add Channel**, then **Submit**:
.. image:: images/manage_conda_channels.jpg
:align: center
:width: 50%

Once you have done this, you can install glue by clicking on the **Install** button corresponding to the **glueviz** entry. If you have already installed glue, and want to update, you can click on the **Update** button.

Command-line installation
Expand All @@ -52,7 +52,7 @@ To install or update glue on the command-line, simply do::
.. note:: There is currently a known issue when running Anaconda's Qt on
certain Linux distributions (including Kubuntu). See
`Issue with PyQt4 from conda`_ for more details.

Enthought Canopy
----------------

Expand Down Expand Up @@ -113,8 +113,9 @@ Glue has the following required dependencies:

And the following optional dependencies are also highly recommended:

* `IPython <http://ipython.org>`_ 1.0 or later
* `SciPy <http://www.scipy.org>`_
* `Astropy <http://www.astropy.org>`_ 0.4 or later
* `Astropy <http://www.astropy.org>`_ 1.0 or later
* `h5py <http://www.h5py.org>`_ (if using HDF5 files)

In addition to these, there are several other optional dependencies to suport
Expand Down Expand Up @@ -195,4 +196,4 @@ insead of PyQt4::
conda install pyside
export QT_API=pyside

after which glue will use PySide when started.
after which glue will use PySide when started.
30 changes: 10 additions & 20 deletions glue/app/qt/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,18 @@
from IPython.utils.traitlets import TraitError
from IPython.lib.kernel import find_connection_file

if IPYTHON_VERSION >= LooseVersion('1'):

from IPython import get_ipython

from IPython.kernel.zmq.ipkernel import Kernel
from IPython.kernel.zmq.kernelapp import IPKernelApp
from IPython.kernel.zmq.iostream import OutStream
from IPython.kernel.inprocess.ipkernel import InProcessInteractiveShell
from IPython.kernel.connect import get_connection_file

from IPython.qt.client import QtKernelClient
from IPython.qt.manager import QtKernelManager
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython import get_ipython

else:
from IPython.kernel.zmq.ipkernel import Kernel
from IPython.kernel.zmq.kernelapp import IPKernelApp
from IPython.kernel.zmq.iostream import OutStream
from IPython.kernel.inprocess.ipkernel import InProcessInteractiveShell
from IPython.kernel.connect import get_connection_file

from IPython.zmq.ipkernel import Kernel
from IPython.zmq.ipkernel import IPKernelApp
from IPython.zmq.iostream import OutStream
from IPython.frontend.qt.kernelmanager import QtKernelManager
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.client import QtKernelClient
from IPython.qt.manager import QtKernelManager
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget

from glue.app.qt.mdi_area import GlueMdiSubWindow
from glue.utils import as_variable_name
Expand Down
6 changes: 3 additions & 3 deletions glue/app/qt/tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from glue.core.component_link import ComponentLink
from glue.core.data_collection import DataCollection
from glue.core.tests.test_state import Cloner, containers_equal, doubler, clone
from glue.tests.helpers import requires_ipython_ge_012
from glue.tests.helpers import requires_ipython
from glue.utils.qt import process_dialog
from glue.viewers.image.qt import ImageWidget
from glue.viewers.scatter.qt import ScatterWidget
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_choose_save_session_ioerror(self):
self.app._choose_save_session()
assert mb.call_count == 1

@requires_ipython_ge_012
@requires_ipython
def test_terminal_present(self):
"""For good setups, terminal is available"""
if not self.app.has_terminal():
Expand Down Expand Up @@ -113,7 +113,7 @@ def is_terminal_importable(self):
except:
return False

@requires_ipython_ge_012
@requires_ipython
def test_toggle_terminal(self):
term = MagicMock()
self.app._terminal = term
Expand Down
6 changes: 3 additions & 3 deletions glue/app/qt/tests/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from mock import MagicMock, patch

from glue.tests.helpers import requires_ipython_ge_012, IPYTHON_GE_012_INSTALLED
from glue.tests.helpers import requires_ipython, IPYTHON_INSTALLED


if IPYTHON_GE_012_INSTALLED:
if IPYTHON_INSTALLED:
from ..terminal import glue_terminal


@requires_ipython_ge_012
@requires_ipython
class TestTerminal(object):
def test_mpl_non_interactive(self):
"""IPython v0.12 sometimes turns on mpl interactive. Ensure
Expand Down
4 changes: 2 additions & 2 deletions glue/core/data_factories/tests/test_data_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from glue.core.data import Data
from glue.core import data_factories as df
from glue.config import data_factory
from glue.tests.helpers import (requires_astropy, requires_astropy_ge_03,
from glue.tests.helpers import (requires_astropy,
requires_pil_or_skimage, make_file, requires_qt)


Expand Down Expand Up @@ -104,7 +104,7 @@ def test_csv_gz_factory():
assert_array_equal(d['x'], [1, 2, 3])


@requires_astropy_ge_03
@requires_astropy
def test_sextractor_factory():
data = b"""# 1 NUMBER Running object number
# 2 X_IMAGE Object position along x [pixel]
Expand Down
5 changes: 2 additions & 3 deletions glue/core/data_factories/tests/test_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

from glue.core import data_factories as df

from glue.tests.helpers import (requires_astropy, requires_astropy_ge_04,
make_file)
from glue.tests.helpers import requires_astropy, make_file

from ..fits import fits_reader

Expand Down Expand Up @@ -172,7 +171,7 @@ def test_fits_uses_mmapping():
assert not d['PRIMARY'].flags['OWNDATA']


@requires_astropy_ge_04
@requires_astropy
def test_fits_catalog_factory():
data = b'\x1f\x8b\x08\x08\x19\r\x9cQ\x02\x03test.fits\x00\xed\xd7AO\x830\x18\xc6\xf1\xe9\'yo\x1c\'\x1c\x8c\x97\x1d\x86c\xa6\x911"5\xc1c\x91n\x92\x8cBJ\x97\xb8o\xef\x06\xd3\x98H\xdd\x16\x97]|~\x17\x12H\xfeyI{h\x136\x8b\xc3\x80hD=8\r\xe9\xb5R\x8bJ\x97\r\x99\x8a\xa6\x8c\'\xd4\x18\xa1r\xa1s\xea\xe53\x1e\xb3\xd4\xd2\xbb\xdb\xf6\x84\xd6bC\xb90\x82\xcc\xa6\x96t@4NYB\x96\xde\xcd\xb6\xa7\xd6e&5U\x8b\xcfrQJ\xd5\x14\x95jz{A\xca\x83hb\xfd\xdf\x93\xb51\x00\x00\x00\x00\xf87v\xc7\xc9\x84\xcd\xa3\x119>\x8b\xf8\xd8\x0f\x03\xe7\xdb\xe7!e\x85\x12zCFd+I\xf2\xddt\x87Sk\xef\xa2\xe7g\xef\xf4\xf3s\xdbs\xfb{\xee\xed\xb6\xb7\x92ji\xdev\xbd\xaf\x12\xb9\x07\xe6\xf3,\xf3\xb9\x96\x9eg\xef\xc5\xf7\xf3\xe7\x88\x1fu_X\xeaj]S-\xb4(\xa5\x91\xba\xff\x7f\x1f~\xeb\xb9?{\xcd\x81\xf5\xe0S\x16\x84\x93\xe4\x98\xf5\xe8\xb6\xcc\xa2\x90\xab\xdc^\xe5\xfc%\x0e\xda\xf5p\xc4\xfe\x95\xf3\x97\xfd\xcc\xa7\xf3\xa7Y\xd7{<Ko7_\xbb\xbeNv\xb6\xf9\xbc\xf3\xcd\x87\xfb\x1b\x00\x00\xc0\xe5\r:W\xfb\xe7\xf5\x00\x00\x00\x00\x00\x00\xac>\x00\x04\x01*\xc7\xc0!\x00\x00'
with make_file(data, '.fits') as fname:
Expand Down
10 changes: 5 additions & 5 deletions glue/core/tests/test_fitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import numpy as np
from mock import MagicMock

from glue.tests.helpers import requires_scipy, requires_astropy_ge_03, ASTROPY_GE_03_INSTALLED
from glue.tests.helpers import requires_scipy, requires_astropy, ASTROPY_INSTALLED

from ..fitters import (PolynomialFitter, IntOption,
BasicGaussianFitter)
needs_modeling = pytest.mark.skipif("False", reason='')


if ASTROPY_GE_03_INSTALLED:
if ASTROPY_INSTALLED:
from astropy.modeling.models import Gaussian1D
try:
from astropy.modeling.fitting import NonLinearLSQFitter
Expand All @@ -22,7 +22,7 @@
from ..fitters import SimpleAstropyGaussianFitter


@requires_astropy_ge_03
@requires_astropy
@requires_scipy
class TestAstropyFitter(object):

Expand Down Expand Up @@ -139,7 +139,7 @@ def test_options_passed_to_fit(self):
assert p.fit.call_args[1]['degree'] == 4


@requires_astropy_ge_03
@requires_astropy
class TestFitWrapper(object):

def setup_method(self, method):
Expand Down Expand Up @@ -168,7 +168,7 @@ def test_basic(self):
np.testing.assert_array_equal(y, self.y)


@requires_astropy_ge_03
@requires_astropy
class TestSetConstraints(object):

def test(self):
Expand Down
4 changes: 2 additions & 2 deletions glue/plugins/coordinate_helpers/tests/test_link_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

from glue.core import ComponentID
from glue.core.tests.test_link_helpers import check_link, check_using
from glue.tests.helpers import ASTROPY_GE_04_INSTALLED
from glue.tests.helpers import ASTROPY_INSTALLED

from ..link_helpers import (Galactic_to_FK5, FK4_to_FK5, ICRS_to_FK5,
Galactic_to_FK4, ICRS_to_FK4, ICRS_to_Galactic)

if not ASTROPY_GE_04_INSTALLED:
if not ASTROPY_INSTALLED:
pytest.skip()


Expand Down
13 changes: 1 addition & 12 deletions glue/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ def make_skipper(module, label=None, version=None):
ASTROPY_INSTALLED, requires_astropy = make_skipper('astropy',
label='Astropy')

ASTROPY_GE_03_INSTALLED, requires_astropy_ge_03 = make_skipper('astropy',
label='Astropy >= 0.3',
version='0.3')

ASTROPY_GE_04_INSTALLED, requires_astropy_ge_04 = make_skipper('astropy',
label='Astropy >= 0.4',
version='0.4')

MATPLOTLIB_GE_14_INSTALLED, requires_matplotlib_ge_14 = make_skipper('matplotlib',
label='Matplotlib >= 1.4',
version='1.4')
Expand All @@ -52,10 +44,7 @@ def make_skipper(module, label=None, version=None):

PLOTLY_INSTALLED, requires_plotly = make_skipper('plotly')

IPYTHON_GE_012_INSTALLED, requires_ipython_ge_012 = make_skipper('IPython',
label='IPython >= 0.12',
version='0.12')

IPYTHON_INSTALLED, requires_ipython = make_skipper('IPython')

requires_pil_or_skimage = pytest.mark.skipif(str(not SKIMAGE_INSTALLED and not PIL_INSTALLED),
reason='Requires PIL or scikit-image')
Expand Down

0 comments on commit 0df6ab3

Please sign in to comment.