Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Merge 4f512f7 into bf35bcb
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Oct 4, 2015
2 parents bf35bcb + 4f512f7 commit 66b40e8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
language: python

# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false

# The apt packages below are needed for sphinx builds
addons:
apt:
packages:
- graphviz
- texlive-latex-extra
- dvipng

python:
- 2.6
- 2.7
Expand Down Expand Up @@ -65,12 +76,6 @@ before_install:
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda

# UPDATE APT-GET LISTINGS
- sudo apt-get update

# DOCUMENTATION DEPENDENCIES
- if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get install graphviz texlive-latex-extra dvipng; fi

# Make sure that interactive matplotlib backends work
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand Down
11 changes: 10 additions & 1 deletion wcsaxes/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@
'fetch_bolocam_hdu',
]

MAX_RETRIES = 10
URL = 'http://data.astropy.org/'


def fetch_hdu(filename, cache=True):
"""Download a FITS file to the cache and open HDU 0.
"""
path = download_file(URL + filename, cache=cache)
for retry in range(MAX_RETRIES):
try:
path = download_file(URL + filename, cache=cache, timeout=30)
except URLError as exc:
pass
else:
break
else:
raise exc
return fits.open(path)[0]


Expand Down

0 comments on commit 66b40e8

Please sign in to comment.