Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Fix splatalogue module with upstream changes #2960

Merged
merged 30 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3da7e65
WIP: first attempt to fix splatalogue [skip ci]
keflavich Feb 27, 2024
caf2746
fix table parsing. Everything works again now?
keflavich Feb 27, 2024
311ae17
fix some of the broken tests
keflavich Feb 27, 2024
9ebf6da
fix keywords invovled in refactor
keflavich Feb 28, 2024
11e31a9
add a dictionary that _can_ be used to restore new tables to old format
keflavich Feb 29, 2024
60af30e
add fixes for minimize_table and column merging
keflavich Mar 5, 2024
a97d07a
remove unused, unsupported slap code
keflavich Mar 5, 2024
d12a7da
fix tests for updated utils
keflavich Mar 5, 2024
91aec4c
add changelog entry
keflavich Mar 13, 2024
62cf9b9
fix data in conftest
keflavich Mar 13, 2024
cb656fa
fix data: remove old/outdated csv and add json
keflavich Mar 13, 2024
9c47f9d
add more cleanup of html junk
keflavich Mar 13, 2024
675c377
remove obsolete merge_frequeencies (there is now a unified frequency …
keflavich Mar 13, 2024
9c20d54
rename some things
keflavich Mar 14, 2024
ad414a2
remove "band" keyword argument as it is no longer used or supported
keflavich Mar 16, 2024
ceecde0
remove "top20" keyword argument as it is no longer used or supported
keflavich Mar 16, 2024
d40a486
fix a few more tests
keflavich Mar 16, 2024
090f737
finally fixed all tests
keflavich Mar 16, 2024
4193f93
whitespace/style cleanup
keflavich Mar 16, 2024
b46834a
package .json data
keflavich Mar 16, 2024
b9384f9
fix mocks (did these _ever_ work?)
keflavich Mar 16, 2024
35a0324
fix order
keflavich Mar 16, 2024
5e3eebc
mocks, etc., are set up in conftest
keflavich Mar 16, 2024
5803174
codestyle: remove imports
keflavich Mar 16, 2024
3b6adf9
add another test to increase coverage slightly
keflavich Mar 16, 2024
09f6211
add another test to improve coverage (remote)
keflavich Mar 16, 2024
94f3c79
Remove unnecessary comment
keflavich Apr 6, 2024
ddff59f
docuemntation cleanup, fix to some parameter validation
keflavich Apr 6, 2024
c5a6d1e
fix template (it turns out to be kind of a useless file but nice as a…
keflavich Apr 6, 2024
9f2c437
Update docs/splatalogue/splatalogue.rst
keflavich Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ mpc

- Parse star catalog information when querying observations database [#2957]

splatalogue
^^^^^^^^^^^

- Fix incompatibilities with the major changes made to the Splatalogue's upstream server in March 2024. [#2960]

vizier
^^^^^^

Expand Down
4 changes: 1 addition & 3 deletions astroquery/splatalogue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ class Conf(_config.ConfigNamespace):
'Splatalogue SLAP interface URL (not used).')
base_url = 'https://splatalogue.online'
query_url = _config.ConfigItem(
f'{base_url}/c_export.php',
# defunct as of Sep 4, 2020? (keeping because this is likely the true host)
# 'https://www.cv.nrao.edu/php/splat/c_export.php',
f'{base_url}/splata-slap/advanceded/false',
'Splatalogue web interface URL.')
timeout = _config.ConfigItem(
60,
Expand Down
335 changes: 185 additions & 150 deletions astroquery/splatalogue/core.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion astroquery/splatalogue/setup_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def get_package_data():
paths_test = [os.path.join('data', 'CO_colons.csv'),
paths_test = [os.path.join('data', 'CO.json'),
]

paths_data = [os.path.join('data', '*.json'),
Expand Down
58 changes: 0 additions & 58 deletions astroquery/splatalogue/slap.py

This file was deleted.

4 changes: 2 additions & 2 deletions astroquery/splatalogue/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
from .core import SplatalogueClass

SplatalogueKelvins = SplatalogueClass(energy_max=500, energy_type='eu_k',
energy_levels=['el4'],
line_strengths=['ls4'],
energy_levels=['Four'],
line_strengths=['CDMSJPL'],
only_NRAO_recommended=True, noHFS=True)
2 changes: 1 addition & 1 deletion astroquery/splatalogue/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from astroquery.utils.mocks import MockResponse


SPLAT_DATA = 'CO_colons.csv'
SPLAT_DATA = 'CO.json'


def data_path(filename):
Expand Down
1 change: 1 addition & 0 deletions astroquery/splatalogue/tests/data/CO.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"species_id": 990, "name": "CO <font color=\"red\">v = 1</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": " 1- 0", "linelist": "CDMS", "LovasASTIntensity": " ", "lower_state_energy": 2143.2711, "upper_state_energy": 2147.08113, "sijmu2": 0.00723, "sij": 1.0, "aij": -7.37879, "intintensity": "-9.7069", "Lovas_NRAO": 1, "orderedfreq": 114221.7523, "lower_state_energy_K": 3083.67129, "upper_state_energy_K": 3089.15304, "orderedFreq": "114221.7523 (0.0013), <span style = 'color: #DC143C'>114221.7523</span>", "measFreq": " <span style = 'color: #DC143C'></span>", "upperStateDegen": "3", "moleculeTag": 28512, "qnCode": 1202, "labref_Lovas_NIST": " ", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": " 1 1 0 1", "lineid": 6187001, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": "Freq in GHz (Err)<br>(rest frame, <p class = 'search-results-red search-results-para'>redshifted<span class = 'search-results-black search-results-para'>)</span></p>", "measFreqColName": "Meas Freq in GHz (Err)<br>(rest frame, <p class = 'search-results-red search-results-para'>redshifted<span class = 'search-results-black search-results-para'>)</span></p>", "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 990, "name": "CO <font color=\"red\">v = 1</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": " 1- 0", "linelist": "SLAIM", "LovasASTIntensity": " ", "lower_state_energy": 2143.272, "upper_state_energy": 2147.08203, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.15428, "intintensity": "", "Lovas_NRAO": 0, "orderedfreq": 114221.757, "lower_state_energy_K": 3083.67258, "upper_state_energy_K": 3089.15433, "orderedFreq": "114221.757 (0.003), <span style = 'color: #DC143C'>114221.757</span>", "measFreq": "114221.74 (0.04), <span style = 'color: #DC143C'>114221.74</span>", "upperStateDegen": "3", "moleculeTag": 0, "qnCode": 0, "labref_Lovas_NIST": " Dix77", "rel_int_HFS_Lovas": "", "unres_quantum_numbers": " 1 - 0 v=1", "lineid": 3768099, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": "1-0", "linelist": "CDMS", "LovasASTIntensity": "60.0", "lower_state_energy": 0.0, "upper_state_energy": 3.84503, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.14246, "intintensity": "-5.0105", "Lovas_NRAO": 1, "orderedfreq": 115271.2018, "lower_state_energy_K": 0.0, "upper_state_energy_K": 5.53211, "orderedFreq": " <span style = 'color: #DC143C'></span>", "measFreq": "115271.2018 (5.0E-4), <span style = 'color: #DC143C'>115271.2018</span>", "upperStateDegen": "3", "moleculeTag": -28503, "qnCode": 101, "labref_Lovas_NIST": " ", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": "J=1-0", "lineid": 363613, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": "Uli76", "source_Lovas_NIST": " OriMC-1", "telescope_Lovas_NIST": " NRAO 11m", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": "1-0", "linelist": "JPL", "LovasASTIntensity": " ", "lower_state_energy": 0.0, "upper_state_energy": 3.84503, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.14246, "intintensity": "-5.0105", "Lovas_NRAO": 0, "orderedfreq": 115271.2018, "lower_state_energy_K": 0.0, "upper_state_energy_K": 5.53211, "orderedFreq": " <span style = 'color: #DC143C'></span>", "measFreq": "115271.2018 (5.0E-4), <span style = 'color: #DC143C'>115271.2018</span>", "upperStateDegen": "3", "moleculeTag": -28001, "qnCode": 101, "labref_Lovas_NIST": " ", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": "J=1-0", "lineid": 824116, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": "1-0", "linelist": "Lovas/NIST", "LovasASTIntensity": "60.0", "lower_state_energy": 0.0, "upper_state_energy": 0.0, "sijmu2": 0.0, "sij": 0.0, "aij": 0.0, "intintensity": "", "Lovas_NRAO": 0, "orderedfreq": 115271.202, "lower_state_energy_K": 0.0, "upper_state_energy_K": 0.0, "orderedFreq": "115271.202 (0.001), <span style = 'color: #DC143C'>115271.202</span>", "measFreq": " <span style = 'color: #DC143C'></span>", "upperStateDegen": "", "moleculeTag": 0, "qnCode": 0, "labref_Lovas_NIST": "", "rel_int_HFS_Lovas": " ", "unres_quantum_numbers": "1-0", "lineid": 3732287, "transition_in_space": 0, "transition_in_G358": 0, "obsref_Lovas_NIST": "Uli76", "source_Lovas_NIST": " OriMC-1", "telescope_Lovas_NIST": " NRAO 11m", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": 204, "name": "CO <font color=\"red\">v = 0</font>", "chemical_name": "Carbon Monoxide", "resolved_QNs": " 1- 0", "linelist": "SLAIM", "LovasASTIntensity": "60.0", "lower_state_energy": 0.0, "upper_state_energy": 3.84503, "sijmu2": 0.01212, "sij": 1.0, "aij": -7.14236, "intintensity": "", "Lovas_NRAO": 0, "orderedfreq": 115271.202, "lower_state_energy_K": 0.0, "upper_state_energy_K": 5.53211, "orderedFreq": "115271.202, <span style = 'color: #DC143C'>115271.202</span>", "measFreq": "115271.202 (0.001), <span style = 'color: #DC143C'>115271.202</span>", "upperStateDegen": "3", "moleculeTag": 0, "qnCode": 0, "labref_Lovas_NIST": " Win97", "rel_int_HFS_Lovas": "", "unres_quantum_numbers": " 1 - 0 v=0", "lineid": 3768098, "transition_in_space": 1, "transition_in_G358": 0, "obsref_Lovas_NIST": " ", "source_Lovas_NIST": " ", "telescope_Lovas_NIST": " ", "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": "datatableskyblue", "searchErrorMessage": "", "sqlquery": null}, {"species_id": null, "name": null, "chemical_name": null, "resolved_QNs": null, "linelist": null, "LovasASTIntensity": null, "lower_state_energy": null, "upper_state_energy": null, "sijmu2": null, "sij": null, "aij": null, "intintensity": null, "Lovas_NRAO": null, "orderedfreq": null, "lower_state_energy_K": null, "upper_state_energy_K": null, "orderedFreq": null, "measFreq": null, "upperStateDegen": null, "moleculeTag": null, "qnCode": null, "labref_Lovas_NIST": null, "rel_int_HFS_Lovas": null, "unres_quantum_numbers": null, "lineid": null, "transition_in_space": null, "transition_in_G358": null, "obsref_Lovas_NIST": null, "source_Lovas_NIST": null, "telescope_Lovas_NIST": null, "orderFreqColName": null, "measFreqColName": null, "transitionBandColor": null, "searchErrorMessage": null, "sqlquery": "SELECT /*+ MAX_EXECUTION_TIME(60000) */species.species_id, species.name, species.chemical_name, main.resolved_QNs, main.frequency, main.uncertainty, main.measfreq, main.measerrfreq, main.rel_int_HFS_Lovas, main.quantum_numbers, main.upper_state_degeneracy, main.molecule_tag, main.qn_code, main.labref_Lovas_NIST, main.line_id ,main.transition_in_space, main.transition_in_G358, main.obsref_Lovas_NIST, main.source_Lovas_NIST, main.telescope_Lovas_NIST , linelists.linelist, main.lower_state_energy ,main.upper_state_energy ,main.upper_state_energy_K ,main.lower_state_energy_K , main.sijmu2, main.aij, main.sij, main.intintensity, main.obsintensity_Lovas_NIST as LovasASTIntensity , main.Lovas_NRAO, main.orderedfreq, main.lower_state_energy_K, main.upper_state_energy_K FROM main INNER JOIN species ON main.species_id = species.species_id INNER JOIN linelists ON main.ll_id = linelists.ll_id AND main.ll_id IN ( 10 ,11 , 12 ,14 ,15 ,16 ,17 ,18 ,19 ) AND (main.species_id = 204 OR main.species_id = 990 OR main.species_id = 991 OR main.species_id = 1343) AND (main.`v3.0` != 0) AND((main.orderedfreq >= 114000.0 AND main.orderedfreq <= 116000.0)) ORDER BY main.orderedfreq"}]
7 changes: 0 additions & 7 deletions astroquery/splatalogue/tests/data/CO_colons.csv

This file was deleted.

Loading
Loading