Skip to content

Commit 3d312c6

Browse files
committed
Merge pull request #557 from vilhelmp/master
Bugfix - payload keyword 'version' should be 'data_version'.
2 parents a12c06f + a55debd commit 3d312c6

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

astroquery/splatalogue/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SplatalogueClass(BaseQuery):
2727
QUERY_URL = conf.query_url
2828
TIMEOUT = conf.timeout
2929
LINES_LIMIT = conf.lines_limit
30-
versions = ('v1.0', 'v2.0')
30+
versions = ('v1.0', 'v2.0', 'vall')
3131
# global constant, not user-configurable
3232
ALL_LINE_LISTS = ('Lovas', 'SLAIM', 'JPL', 'CDMS', 'ToyoMA', 'OSU',
3333
'Recomb', 'Lisa', 'RFI')
@@ -170,7 +170,7 @@ def _parse_kwargs(self, min_frequency=None, max_frequency=None,
170170
The type of intensity on which to place a lower limit
171171
transition : str
172172
e.g. 1-0
173-
version : ``'v1.0'`` or ``'v2.0'``
173+
version : ``'v1.0'`` or ``'v2.0'`` or ``'vall'``
174174
Data version
175175
exclude : list
176176
Types of lines to exclude. Default is:
@@ -275,7 +275,7 @@ def _parse_kwargs(self, min_frequency=None, max_frequency=None,
275275
payload['tran'] = transition
276276

277277
if version in self.versions:
278-
payload['version'] = version
278+
payload['data_version'] = version
279279
elif version is not None:
280280
raise ValueError("Invalid version specified. Allowed versions are {vers}".format(vers=str(self.versions)))
281281

astroquery/splatalogue/tests/test_splatalogue.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from ... import splatalogue
33
from ...utils.testing_tools import MockResponse
44
from astropy import units as u
5-
from astropy.tests.helper import pytest
5+
from astropy.tests.helper import pytest, remote_data
66
import requests
77
import os
88

@@ -61,6 +61,7 @@ def test_get_payload():
6161
get_query_payload=True)
6262
assert '__utma' in q
6363

64+
6465
# regression test: line lists should ask for only one line list, not all
6566
def test_line_lists():
6667
q = splatalogue.core.Splatalogue.query_lines_async(1 * u.GHz, 10 * u.GHz,
@@ -97,3 +98,15 @@ def test_band_crashorno():
9798
splatalogue.core.Splatalogue.query_lines_async(band='invalid',
9899
get_query_payload=True)
99100
assert exc.value.args[0] == "Invalid frequency band."
101+
102+
103+
# regression test : version selection should work
104+
@remote_data
105+
def test_version_selection():
106+
results = splatalogue.Splatalogue.query_lines(
107+
min_frequency= 703*u.GHz,
108+
max_frequency=706*u.GHz,
109+
chemical_name='Acetaldehyde',
110+
version='v1.0'
111+
)
112+
assert len(results)==1

0 commit comments

Comments
 (0)