Skip to content

Commit

Permalink
Merge pull request #1477 from Cadair/astropy_channel
Browse files Browse the repository at this point in the history
update installation instructions to use astropy conda channel
  • Loading branch information
ayshih committed Jul 6, 2015
2 parents 51549d5 + 7b527e3 commit 90d2b2a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ before_install:
install:
# Add a conda env and set up extra binstar channels
- conda create --yes -n test python=$PYTHON_VERSION
- conda config --add channels sunpy --add channels astropy-ci-extras --add channels https://conda.binstar.org/sunpy/channel/citesting
- conda config --add channels sunpy --add channels astropy --add channels astropy-ci-extras --add channels https://conda.binstar.org/sunpy/channel/citesting
- source activate test
# Install default dependancies
- conda install --yes pip
- conda install -q --yes numpy=$NUMPY_VERSION pandas=$PANDAS_VERSION
- conda install -q --yes scipy matplotlib requests beautiful-soup sqlalchemy scikit-image pytest jinja2 cython
- conda install -q --yes scipy matplotlib requests beautiful-soup sqlalchemy scikit-image pytest jinja2 cython wcsaxes
- pip install pytest-cov coverage coveralls
# Install sunpy conda packages
- conda install -q --yes suds-jurko glymur
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ install:
- "conda update --yes conda"
# Create a conda environment using the astropy bonus packages
- "conda create -q --yes -n test -c astropy-ci-extras python=%PYTHON_VERSION%"
- "conda config --add channels https://conda.binstar.org/sunpy"
- "conda config --add channels https://conda.binstar.org/sunpy --add channels astropy"
- "activate test"

# Install default dependancies
- "conda install -q --yes numpy scipy astropy matplotlib pandas requests beautiful-soup sqlalchemy scikit-image pytest"
- "conda install -q --yes numpy scipy astropy matplotlib pandas requests beautiful-soup sqlalchemy scikit-image pytest wcsaxes"

# Install sunpy conda packages
- "conda install -q --yes suds-jurko glymur"
Expand Down
2 changes: 1 addition & 1 deletion doc/source/guide/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To install SunPy launch a system command prompt or the

To configure conda for sunpy downloads run::

conda config --add channels sunpy
conda config --add channels sunpy --add channels astropy

To install SunPy run::
Expand Down
21 changes: 20 additions & 1 deletion sunpy/map/tests/test_mapbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
from astropy.io import fits
import astropy.units as u
from astropy.tests.helper import assert_quantity_allclose
import matplotlib.pyplot as plt

import sunpy
import sunpy.sun
import sunpy.map
import sunpy.data.test
from sunpy.time import parse_time
from sunpy.tests.helpers import figure_test
from sunpy.tests.helpers import figure_test, skip_wcsaxes

testpath = sunpy.data.test.rootdir

Expand Down Expand Up @@ -409,11 +410,19 @@ def test_rotate_invalid_order(generic_map):
generic_map.rotate(order=-1)


@skip_wcsaxes
@figure_test
def test_plot_aia171(aia171_test_map):
aia171_test_map.plot()


@figure_test
def test_plot_aia171_nowcsaxes(aia171_test_map):
ax = plt.gca()
aia171_test_map.plot(axes=ax)


@skip_wcsaxes
@figure_test
def test_plot_masked_aia171(aia171_test_map):
shape = aia171_test_map.data.shape
Expand All @@ -422,3 +431,13 @@ def test_plot_masked_aia171(aia171_test_map):
masked_map = sunpy.map.Map(np.ma.array(aia171_test_map.data, mask=mask), aia171_test_map.meta)
masked_map.plot()


@figure_test
def test_plot_masked_aia171_nowcsaxes(aia171_test_map):
shape = aia171_test_map.data.shape
mask = np.zeros_like(aia171_test_map.data, dtype=bool)
mask[0:shape[0]/2, 0:shape[1]/2] = True
masked_map = sunpy.map.Map(np.ma.array(aia171_test_map.data, mask=mask), aia171_test_map.meta)
ax = plt.gca()
masked_map.plot(axes=ax)

6 changes: 4 additions & 2 deletions sunpy/tests/figure_hashes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"sunpy.map.tests.test_mapbase.test_plot_aia171": "62b5b9fc1a423e3cbeeea85d3b8daf1a7877099fdeda2ce9352746be1dd451fc",
"sunpy.map.tests.test_mapbase.test_plot_masked_aia171": "d70f0e5797fc864498e0bed5326afdba1e6400aa8c7aa81729f33007b4663157"
"sunpy.map.tests.test_mapbase.test_plot_aia171": "0a9285740e89fedb0a5d9993cc5d3409a5567cb1597e18bfe77fcd808443856f",
"sunpy.map.tests.test_mapbase.test_plot_aia171_nowcsaxes": "62b5b9fc1a423e3cbeeea85d3b8daf1a7877099fdeda2ce9352746be1dd451fc",
"sunpy.map.tests.test_mapbase.test_plot_masked_aia171": "36248d77b8a3947202256e4d88ba053b9ee10ac538ea11603a651e0f2af1953a",
"sunpy.map.tests.test_mapbase.test_plot_masked_aia171_nowcsaxes": "d70f0e5797fc864498e0bed5326afdba1e6400aa8c7aa81729f33007b4663157"
}
12 changes: 11 additions & 1 deletion sunpy/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from sunpy.tests import hash

__all__ = ['skip_windows', 'skip_glymur', 'skip_ana', 'warnings_as_errors']
__all__ = ['skip_windows', 'skip_glymur', 'skip_ana', 'skip_wcsaxes', 'warnings_as_errors']

# SunPy's JPEG2000 capabilities rely on the glymur library. First we check to
# make sure that glymur imports correctly before proceeding.
Expand Down Expand Up @@ -42,12 +42,22 @@
else:
SKIP_ANA = SKIP_ANA or False


try:
import wcsaxes
except ImportError:
SKIP_WCSAXES = True
else:
SKIP_WCSAXES = False

skip_windows = pytest.mark.skipif(platform.system() == 'Windows', reason="Windows")

skip_glymur = pytest.mark.skipif(SKIP_GLYMUR, reason="Glymur can not be imported")

skip_ana = pytest.mark.skipif(SKIP_ANA, reason="ANA is not available")

skip_wcsaxes = pytest.mark.skipif(SKIP_WCSAXES, reason="wcsaxes is not available")

@pytest.fixture
def warnings_as_errors(request):
warnings.simplefilter('error')
Expand Down

0 comments on commit 90d2b2a

Please sign in to comment.