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

Linelists: make lookuptables a little more robust #2901

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 1 deletion astroquery/jplspec/lookup_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@

Returns
-------
The list of values corresponding to the matches
The dictionary containing only values whose keys match the regex

"""

if s in self:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, my eyes hurt, could we make this called something longer than s? I suspect that would mean a deprecation--rename?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we renamed it to st in the other instance. But this particular argument is barely user-facing; I don't know that we need to deprecate it

return {s: self[s]}

Check warning on line 30 in astroquery/jplspec/lookup_table.py

View check run for this annotation

Codecov / codecov/patch

astroquery/jplspec/lookup_table.py#L30

Added line #L30 was not covered by tests

R = re.compile(s, flags)

out = {}
Expand Down
5 changes: 4 additions & 1 deletion astroquery/linelists/cdms/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,13 @@

Returns
-------
The list of values corresponding to the matches
The dictionary containing only values whose keys match the regex

"""

if st in self:
return {st: self[st]}

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

View check run for this annotation

Codecov / codecov/patch

astroquery/linelists/cdms/core.py#L383

Added line #L383 was not covered by tests

out = {}

for kk, vv in self.items():
Expand Down
Loading