Skip to content

Commit

Permalink
update docstr, inline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Jan 17, 2025
1 parent a4b0843 commit 492d3c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion astroquery/jplspec/lookup_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def find(self, st, flags):
Parameters
----------
s : str
st : str
String to compile as a regular expression
Can be entered non-specific for broader results
('H2O' yields 'H2O' but will also yield 'HCCCH2OD')
Expand Down
4 changes: 4 additions & 0 deletions astroquery/linelists/cdms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class Conf(_config.ConfigNamespace):
Configuration parameters for `astroquery.linelists.cdms`.
"""
server = _config.ConfigItem(
'https://cdms.astro.uni-koeln.de/',
'CDMS Search and Conversion Form URL.')

search = _config.ConfigItem(
'https://cdms.astro.uni-koeln.de/cgi-bin/cdmssearch',
'CDMS Search and Conversion Form URL.')

Expand Down
8 changes: 5 additions & 3 deletions astroquery/linelists/cdms/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def data_path(filename):
@async_to_sync
class CDMSClass(BaseQuery):
# use the Configuration Items imported from __init__.py
URL = conf.server
URL = conf.search
SERVER = conf.server
CLASSIC_URL = conf.classic_server
TIMEOUT = conf.timeout
MALFORMATTED_MOLECULE_LIST = ['017506 NH3-wHFS', '028582 H2NC', '058501 H2C2S', '064527 HC3HCN']
Expand Down Expand Up @@ -539,7 +540,7 @@ def build_lookup():
return lookuptable


def retrieve_catfile(url='https://cdms.astro.uni-koeln.de/classic/entries/partition_function.html'):
def retrieve_catfile(url=f'{conf.classic_server}/entries/partition_function.html'):
"""
Simple retrieve index function
"""
Expand Down Expand Up @@ -581,7 +582,7 @@ def tryfloat(x):
return tbl

Check warning on line 582 in astroquery/linelists/cdms/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/linelists/cdms/core.py#L582

Added line #L582 was not covered by tests


def retrieve_catfile2(url='https://cdms.astro.uni-koeln.de/classic/predictions/catalog/catdir.html'):
def retrieve_catfile2(url=f'{conf.classic_server}/predictions/catalog/catdir.html'):
"""
Simple retrieve index function
"""
Expand All @@ -591,6 +592,7 @@ def retrieve_catfile2(url='https://cdms.astro.uni-koeln.de/classic/predictions/c
tbl = ascii.read(response.text, format='html')
except UnicodeDecodeError:

Check warning on line 593 in astroquery/linelists/cdms/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/linelists/cdms/core.py#L589-L593

Added lines #L589 - L593 were not covered by tests
# based on https://github.com/astropy/astropy/issues/3826#issuecomment-256113937
# which suggests to start with the bytecode content and decode with 'replace errors'
text = response.content.decode('ascii', errors='replace')
tbl = ascii.read(text, format='html')

Check warning on line 597 in astroquery/linelists/cdms/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/linelists/cdms/core.py#L596-L597

Added lines #L596 - L597 were not covered by tests

Expand Down

0 comments on commit 492d3c3

Please sign in to comment.