Skip to content

Commit dbba11a

Browse files
committed
propagate column change down
trivial formatting fix my refactor; it was incorrect oops, fix to last one (yes, this needs to be squashed; pushing fast to skip tests... and spam my inbox...)
1 parent 34bd35b commit dbba11a

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

astroquery/linelists/cdms/core.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def query_lines_async(self, min_frequency, max_frequency, *,
148148
'refine your search or read the Docs '
149149
'for pointers on how to search.')
150150
payload['Molecules'] = tuple(f"{val:06d} {key}"
151-
for key, val in luts.items())[0]
151+
for key, val in luts.items())[0]
152152
else:
153153
payload['Molecules'] = molecule
154154

@@ -453,19 +453,19 @@ def _parse_cat(self, response, *, verbose=False):
453453
'TAG': 44,
454454
'QNFMT': 52,
455455
'Q1': 55,
456-
'Q2': 58,
457-
'Q3': 60,
458-
'Q4': 62,
459-
'Q5': 64,
460-
'Q6': 66,
461-
'Q7': 68,
462-
'Q8': 70,
463-
'Q9': 72,
464-
'Q10': 74,
465-
'Q11': 76,
466-
'Q12': 78,
467-
'Q13': 80,
468-
'Q14': 82,
456+
'Q2': 57,
457+
'Q3': 59,
458+
'Q4': 61,
459+
'Q5': 63,
460+
'Q6': 65,
461+
'Q7': 67,
462+
'Q8': 69,
463+
'Q9': 71,
464+
'Q10': 73,
465+
'Q11': 75,
466+
'Q12': 77,
467+
'Q13': 79,
468+
'Q14': 81,
469469
}
470470

471471
result = ascii.read(text, header_start=None, data_start=0,

astroquery/linelists/cdms/tests/test_cdms_remote.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,24 @@ def test_remote_300K():
4141
assert tbl['MOLWT'][0] == 18
4242

4343

44+
@pytest.mark.remote_data
45+
def test_co_basics():
46+
tbl = CDMS.get_molecule('028503')
47+
assert tbl['Q1'][0] == 1
48+
assert tbl['Q7'][0] == 0
49+
assert tbl['Q1'][10] == 11
50+
assert tbl['Q7'][10] == 10
51+
assert tbl['MOLWT'][0] == 28
52+
53+
4454
@pytest.mark.remote_data
4555
def test_propanediol():
4656
tbl1 = CDMS.get_molecule('076513')
4757
assert 'int' in tbl1['Q2'].dtype.name
4858

4959
tbl = CDMS.query_lines(min_frequency=100.3 * u.GHz,
5060
max_frequency=100.5 * u.GHz,
51-
molecule='076513',
52-
)
61+
molecule='076513')
5362
assert isinstance(tbl, Table)
5463
assert len(tbl) >= 1
5564
assert 'aG\'g-1,2-Propanediol' in tbl['name']
@@ -146,8 +155,8 @@ def test_remote_all_species():
146155
min_strength=-5)
147156
assert isinstance(tbl, Table)
148157

149-
AlS_is_in_table = np.char.find(tbl['name'], 'AlS') != -1
150-
Propanediol_is_in_table = np.char.find(tbl['name'], "aG'g-1,2-Propanediol") != -1
158+
AlS_is_in_table = (tbl['name'] == 'AlS').sum() > 0
159+
Propanediol_is_in_table = (tbl['name'] == "aG'g-1,2-Propanediol").sum() > 0
151160

152161
assert AlS_is_in_table
153162
assert Propanediol_is_in_table
@@ -165,4 +174,4 @@ def test_regression_allcats(self, row):
165174
"""
166175
tag = f"{row['tag']:06d}"
167176
result = CDMS.get_molecule(tag)
168-
assert len(result) >= 1
177+
assert len(result) >= 1

0 commit comments

Comments
 (0)