Skip to content

Commit

Permalink
allow lookuptable to skip regex searching for exact matches
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Dec 19, 2023
1 parent 5600762 commit 869de3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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 @@ def find(self, s, flags):
Returns
-------
The list of values corresponding to the matches
The dictionary containing only values whose keys match the regex
"""

if s in self:
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 @@ def find(self, st, flags):
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

0 comments on commit 869de3d

Please sign in to comment.