Skip to content

Commit 08f6d70

Browse files
committed
Merge pull request #637 from keflavich/issue637
Toward 0.3.1 release: remote-data failures
2 parents cca8321 + 4e91895 commit 08f6d70

File tree

10 files changed

+25
-13
lines changed

10 files changed

+25
-13
lines changed

CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
0.3.1.dev
2-
---------
1+
0.3.1 (2016-01-11)
2+
------------------
33

44
- Fix bug in xmatch service that required astropy tables to have exactly 2
55
columns on input (#641)

astroquery/alma/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Conf(_config.ConfigNamespace):
2323
conf = Conf()
2424

2525
from .core import Alma, AlmaClass
26+
from .utils import make_finder_chart
2627

2728
__all__ = ['Alma', 'AlmaClass',
2829
'Conf', 'conf',

astroquery/alma/tests/test_alma_remote.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
class TestAlma:
3434

3535
def setup_class(cls):
36-
Alma.archive_url = 'http://beta.cadc-ccda.hia-iha.nrc-cnrc.gc.ca'
36+
pass
37+
# starting somewhere between Nov 2015 and Jan 2016, the beta server
38+
# stopped serving the actual data, making all staging attempts break
39+
#Alma.archive_url = 'http://beta.cadc-ccda.hia-iha.nrc-cnrc.gc.ca'
3740

3841
@pytest.fixture()
3942
def temp_dir(self, request):
@@ -66,9 +69,9 @@ def test_m83(self, temp_dir):
6669
alma = Alma()
6770
alma.cache_location = temp_dir
6871

69-
result_s = alma.query_object('M83')
72+
m83_data = alma.query_object('M83')
7073
uids = np.unique(m83_data['Member ous id'])
71-
link_list = Alma.stage_data(uids)
74+
link_list = alma.stage_data(uids)
7275

7376
def test_stage_data(self, temp_dir):
7477
alma = Alma()

astroquery/alma/tests/test_alma_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ def test_make_finder_chart():
6767

6868
assert len(catalog) >= 7
6969
assert len(images) >= 1
70-
assert hit_mask_public[3].mean() >= 49
70+
assert 3 in hit_mask_public
71+
assert hit_mask_public[3][256,256] >= 60

astroquery/alma/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ def parse_frequency_support(frequency_support_str):
8989
Quantities representing the frequency range. It will ignore the resolution
9090
and polarizations.
9191
"""
92-
supports = str(frequency_support_str).split('U')
92+
if not isinstance(frequency_support_str, str):
93+
supports = frequency_support_str.tostring().decode('ascii').split('U')
94+
else:
95+
supports = frequency_support_str.split('U')
9396

9497
freq_ranges = [(float(sup[0]),
9598
float(sup[1].split(',')[0].strip(string.ascii_letters))) *

astroquery/lamda/tests/test_lamda_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def test_query():
1111
result = lamda.Lamda.query(mol='co')
1212
assert [len(r) for r in result] == [2, 40, 41]
1313
collider_dict = result[0]
14-
assert collider_dict.keys() == ['PH2', 'OH2']
14+
assert set(collider_dict.keys()) == set(['PH2', 'OH2'])
1515
assert [len(collider_dict[r]) for r in collider_dict] == [820, 820]

astroquery/nasa_ads/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def query_simple(self, query_string, get_query_payload=False,
4848
data=request_payload, timeout=self.TIMEOUT,
4949
cache=cache)
5050

51+
response.raise_for_status()
52+
5153
# primarily for debug purposes, but also useful if you want to send
5254
# someone a URL linking directly to the data
5355
if get_query_payload:

astroquery/simbad/tests/test_simbad_remote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ def test_query_objects_null(self):
129129
# Special case of null test: zero-sized region
130130
def test_query_region_null(self):
131131
result = simbad.core.Simbad.query_region(
132-
coord.SkyCoord("00h00m0.0s 00h00m0.0s"), radius="0d",
132+
coord.SkyCoord("00h01m0.0s 00h00m0.0s"), radius="0d",
133133
equinox=2000.0, epoch='J2000')
134134
assert result is None
135135

136136
# Special case of null test: very small region
137137
def test_query_small_region_null(self):
138138
result = simbad.core.Simbad.query_region(
139-
coord.SkyCoord("00h00m0.0s 00h00m0.0s"), radius=1.0 * u.marcsec,
139+
coord.SkyCoord("00h01m0.0s 00h00m0.0s"), radius=1.0 * u.marcsec,
140140
equinox=2000.0, epoch='J2000')
141141
assert result is None
142142

astroquery/splatalogue/tests/test_splatalogue.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ def test_band_crashorno():
104104

105105

106106
# regression test : version selection should work
107+
# Unfortunately, it looks like version1 = version2 on the web page now, so this
108+
# may no longer be a valid test
107109
@remote_data
108110
def test_version_selection():
109111
results = splatalogue.Splatalogue.query_lines(
110112
min_frequency=703 * u.GHz, max_frequency=706 * u.GHz,
111113
chemical_name='Acetaldehyde', version='v1.0')
112114

113-
assert len(results) == 1
115+
assert len(results) == 133

astroquery/utils/commons.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def send_request(url, data, timeout, request_type='POST', headers={},
103103
except requests.exceptions.Timeout:
104104
raise TimeoutError("Query timed out, time elapsed {time}s".
105105
format(time=timeout))
106-
except requests.exceptions.RequestException:
107-
raise Exception("Query failed\n")
106+
except requests.exceptions.RequestException as ex:
107+
raise Exception("Query failed: {0}\n".format(ex))
108108

109109

110110
def parse_radius(radius):

0 commit comments

Comments
 (0)